pmb.flasher/export: Add --no-install option to skip kernel/initfs update (!1863)

At the moment, pmbootstrap updates the kernel and the initfs whenever
using the flasher or export. This is useful, but sometimes you just want
to boot exactly the same kernel several times. In that case, having to wait
several seconds for the (redundant) update to complete is quite annoying.

Add a --no-install option that allows skipping the kernel/initfs update.
This commit is contained in:
Minecrell 2020-01-22 19:30:43 +01:00 committed by Oliver Smith
parent 8f4bd7dea1
commit 60217d0818
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
4 changed files with 13 additions and 6 deletions

View file

@ -46,13 +46,14 @@ import pmb.parse
import pmb.qemu
def _parse_flavor(args):
def _parse_flavor(args, autoinstall=True):
"""
Verify the flavor argument if specified, or return a default value.
:param autoinstall: make sure that at least one kernel flavor is installed
"""
# Install at least one kernel and get installed flavors
suffix = "rootfs_" + args.device
flavors = pmb.chroot.other.kernel_flavors_installed(args, suffix)
flavors = pmb.chroot.other.kernel_flavors_installed(args, suffix, autoinstall)
# Parse and verify the flavor argument
flavor = args.flavor