From: Daan De Meyer Date: Thu, 19 Oct 2023 09:41:40 +0000 (+0200) Subject: openmandriva: Copy kernel image to /usr X-Git-Tag: v19~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8edf0cfb51cb5343da9edd241f3d328feaa002fb;p=thirdparty%2Fmkosi.git openmandriva: Copy kernel image to /usr Same as for Debian and Mageia, except we have to get rid of a symlink as well. --- diff --git a/mkosi/distributions/openmandriva.py b/mkosi/distributions/openmandriva.py index bce607124..ee7aaacc4 100644 --- a/mkosi/distributions/openmandriva.py +++ b/mkosi/distributions/openmandriva.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1+ +import shutil from collections.abc import Sequence from mkosi.architecture import Architecture @@ -67,6 +68,16 @@ class Installer(DistributionInstaller): def install_packages(cls, state: MkosiState, packages: Sequence[str], apivfs: bool = True) -> None: invoke_dnf(state, "install", packages, apivfs=apivfs) + for d in state.root.glob("boot/vmlinuz-*"): + kver = d.name.removeprefix("vmlinuz-") + vmlinuz = state.root / "usr/lib/modules" / kver / "vmlinuz" + # Openmandriva symlinks /usr/lib/modules//vmlinuz to /boot/vmlinuz-, so get rid of the symlink + # and put the actual vmlinuz in /usr/lib/modules/. + if vmlinuz.is_symlink(): + vmlinuz.unlink() + if not vmlinuz.exists(): + shutil.copy2(d, vmlinuz) + @classmethod def remove_packages(cls, state: MkosiState, packages: Sequence[str]) -> None: invoke_dnf(state, "remove", packages)