From: Clayton Craft Date: Mon, 29 Sep 2025 17:57:04 +0000 (-0700) Subject: postmarketos: implement is_kernel_package X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e805253447bbab0cf6b21fe2acc08082a86be16e;p=thirdparty%2Fmkosi.git postmarketos: implement is_kernel_package There are many many kernel packages in pmOS+Alpine and the pkg names don't follow any specific pattern that sets them apart from some other non-kernel packages, so the implementation tries to exclude known pkgs that are not kernels and assume anything that doesn't match these package names/patterns are kernel packages. --- diff --git a/mkosi/distributions/postmarketos.py b/mkosi/distributions/postmarketos.py index c62d17a7e..13209f9d5 100644 --- a/mkosi/distributions/postmarketos.py +++ b/mkosi/distributions/postmarketos.py @@ -112,5 +112,21 @@ class Installer(DistributionInstaller): @classmethod def is_kernel_package(cls, package: str) -> bool: - # TODO: Cover all of postmarketos's kernel packages. - return package == "linux-virt" + if not package.startswith("linux-"): + return False + + if package.endswith(("-doc", "-dev", "-manual")): + return False + + # These pkgs end with many different things + if package.startswith(("linux-tools-", "linux-firmware-")): + return False + + if package in { + "linux-timemachine", + "linux-headers", + "linux-apfs-rw-src", + }: + return False + + return True