]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Copy over kernel images from /boot for opensuse as well
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 4 Jan 2024 09:49:21 +0000 (10:49 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 4 Jan 2024 16:08:01 +0000 (17:08 +0100)
On Tumbleweed they're already in /usr/lib/modules but on older
releases they aren't so copy them over like we do for debian.

mkosi/distributions/opensuse.py

index 17b6300934d60c57e8b8fa04fdae24d61507de24..41bedceaac07e01148fecd2974e3e602f78d2fa5 100644 (file)
@@ -99,6 +99,13 @@ class Installer(DistributionInstaller):
         else:
             invoke_dnf(context, "install", packages, apivfs=apivfs)
 
+        # Leap doesn't put its kernel images in /usr/lib/modules so copy them over if needed.
+        for d in context.root.glob("boot/vmlinuz-*"):
+            kver = d.name.removeprefix("vmlinuz-")
+            vmlinuz = context.root / "usr/lib/modules" / kver / "vmlinuz"
+            if not vmlinuz.exists():
+                shutil.copy2(d, vmlinuz)
+
     @classmethod
     def remove_packages(cls, context: Context, packages: Sequence[str]) -> None:
         if shutil.which("zypper"):