chroot/other/kernel_flavor_installed: support generic kernel name (MR 2093)

kernel is named /boot/vmlinuz now, looking at the filename will no
longer tell us what flavor it is. This now will look at
/usr/share/kernel, which has always contained the kernel 'flavor', and
since we currently only install 1 kernel these days, guarding this with
pmaports.cfg should be unnecessary. In the worst case (if there are
multiple kernel 'flavors' installed), it'll just grab the first one and
return it.
This commit is contained in:
Clayton Craft 2021-08-18 16:31:59 -07:00
parent 184ac91ec5
commit 09794ef832
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 26 additions and 32 deletions

View file

@ -80,8 +80,7 @@ def ls(args, flavor, suffix, extra=False):
def frontend(args):
# Find the appropriate kernel flavor
suffix = f"rootfs_{args.device}"
flavors = pmb.chroot.other.kernel_flavors_installed(args, suffix)
flavor = flavors[0]
flavor = pmb.chroot.other.kernel_flavor_installed(args, suffix)
# Handle initfs actions
action = args.action_initfs
@ -107,9 +106,8 @@ def frontend(args):
elif action == "hook_del":
pmb.chroot.initfs_hooks.delete(args, args.hook, suffix)
# Rebuild the initfs for all kernels after adding/removing a hook
for flavor in flavors:
build(args, flavor, suffix)
# Rebuild the initfs after adding/removing a hook
build(args, flavor, suffix)
if action in ["ls", "extract"]:
link = "https://wiki.postmarketos.org/wiki/Initramfs_development"