]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
postmarketos: implement is_kernel_package
authorClayton Craft <clayton@craftyguy.net>
Mon, 29 Sep 2025 17:57:04 +0000 (10:57 -0700)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 29 Sep 2025 19:00:33 +0000 (21:00 +0200)
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

index c62d17a7e5cf5c12ccd0b4cbdb06f660d3ae0cd0..13209f9d5b6ddc45bc4073f6bdccc9064dd65baf 100644 (file)
@@ -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