qemu: allow the user to specify the kernel flavor (#1256)

This commit is contained in:
Luca Weiss 2018-02-25 20:20:22 +01:00 committed by Oliver Smith
parent 948b5af09b
commit 6b9e7ecf75
2 changed files with 6 additions and 1 deletions

View File

@ -111,6 +111,8 @@ def arguments_qemu(subparser):
help="guest RAM (default: 1024)")
ret.add_argument("-p", "--port", type=int, default=2222,
help="SSH port (default: 2222)")
ret.add_argument("--flavor", help="name of the kernel flavor (run 'pmbootstrap flasher list_flavors'"
" to get a list of all installed flavors")
display = ret.add_mutually_exclusive_group()
display.add_argument("--spice", dest="spice_port", const="8077",

View File

@ -114,7 +114,10 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
suffix = "rootfs_" + device
rootfs = args.work + "/chroot_" + suffix
flavor = pmb.chroot.other.kernel_flavor_autodetect(args, suffix)
if args.flavor:
flavor = args.flavor
else:
flavor = pmb.chroot.other.kernel_flavor_autodetect(args, suffix)
command = [qemu_bin]
command += ["-kernel", rootfs + "/boot/vmlinuz-" + flavor]
command += ["-initrd", rootfs + "/boot/initramfs-" + flavor]