diff options
author | Andy Lutomirski <luto@kernel.org> | 2019-10-16 12:25:36 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@kernel.org> | 2019-10-16 12:25:36 -0700 |
commit | 8a914171ac633ad4b88ac704b6a5693c2e2e6164 (patch) | |
tree | 0a373ddcac69dbd2a64305db0c041bcea95c8676 | |
parent | d2438fe1ba0c379a50bcd01bd310c7a310242ca6 (diff) | |
download | virtme-8a914171ac633ad4b88ac704b6a5693c2e2e6164.tar.gz |
Make --save-initramfs --show-command output more useful
Now --save-initramfs uses the actual filesystem path for QEMU's -initrd.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rw-r--r-- | virtme/commands/run.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/virtme/commands/run.py b/virtme/commands/run.py index 7526dea..4c354a1 100644 --- a/virtme/commands/run.py +++ b/virtme/commands/run.py @@ -529,8 +529,11 @@ def do_it() -> int: initramfsfile = os.fdopen(initramfsfd, 'r+b') mkinitramfs.mkinitramfs(initramfsfile, config) initramfsfile.flush() - fcntl.fcntl(initramfsfd, fcntl.F_SETFD, 0) - initrdpath = '/proc/self/fd/%d' % initramfsfd + if args.save_initramfs is not None: + initrdpath = args.save_initramfs + else: + fcntl.fcntl(initramfsfd, fcntl.F_SETFD, 0) + initrdpath = '/proc/self/fd/%d' % initramfsfd else: if args.save_initramfs is not None: print('--save_initramfs specified but initramfs is not used', |