mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 19:39:51 +03:00
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:
parent
184ac91ec5
commit
09794ef832
6 changed files with 26 additions and 32 deletions
|
@ -38,17 +38,19 @@ 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
|
||||
# Install a kernel and get its "flavor", where flavor is a pmOS-specific
|
||||
# identifier that is typically in the form
|
||||
# "postmarketos-<manufacturer>-<device/chip>", e.g.
|
||||
# "postmarketos-qcom-sdm845"
|
||||
suffix = "rootfs_" + args.device
|
||||
flavors = pmb.chroot.other.kernel_flavors_installed(
|
||||
flavor = pmb.chroot.other.kernel_flavor_installed(
|
||||
args, suffix, autoinstall)
|
||||
|
||||
# Parse and verify flavor
|
||||
if not len(flavors):
|
||||
if not flavor:
|
||||
raise RuntimeError(
|
||||
"No kernel flavors installed in chroot " + suffix + "! Please let"
|
||||
" your device package depend on a package starting with 'linux-'.")
|
||||
return flavors[0]
|
||||
return flavor
|
||||
|
||||
|
||||
def _parse_suffix(args):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue