From e805253447bbab0cf6b21fe2acc08082a86be16e Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Mon, 29 Sep 2025 10:57:04 -0700 Subject: [PATCH] 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. --- mkosi/distributions/postmarketos.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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 -- 2.47.3