Skip to content

Commit

Permalink
fix: Ommit append option when running in user mode with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemek Recha committed Nov 30, 2023
1 parent 9d2bd75 commit 3b5b5e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qemu_runner/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def _yield_args():
yield layer.general.kernel

if layer.general.kernel_cmdline:
yield '-append'
if not layer.general.mode or layer.general.mode == Mode.System:
yield '-append'
yield layer.general.kernel_cmdline

return list(_yield_args())
4 changes: 4 additions & 0 deletions tests/test_layer_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
Layer(GeneralSettings(engine='my-engine', kernel='abc.elf', kernel_cmdline='a b c')),
['my-engine', '-kernel', 'abc.elf', '-append', 'a b c']
),
(
Layer(GeneralSettings(engine='my-engine', kernel='abc.elf', mode=Mode.User, kernel_cmdline='a b c')),
['my-engine', 'abc.elf', 'a b c']
),
(
Layer(
GeneralSettings(engine='my-engine', halted=True, gdb=True, kernel='abc.elf', kernel_cmdline='a b c'),
Expand Down

0 comments on commit 3b5b5e2

Please sign in to comment.