From: Daan De Meyer Date: Fri, 15 Jul 2022 21:01:46 +0000 (+0200) Subject: arch: Move bios kernel-install workaround to install function X-Git-Tag: v14~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c3996d94df78d13ba563ea0892e28ff6bc9173;p=thirdparty%2Fmkosi.git arch: Move bios kernel-install workaround to install function We can already create the symlinks early in the install function. This removes one more distribution specific check. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index c569e7de0..7607b35a3 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2970,6 +2970,14 @@ def install_arch(args: MkosiArgs, root: Path, do_run_build_script: bool) -> None # systemd-nspawn containers. See https://bugs.archlinux.org/task/45903. disable_pam_securetty(root) + # grub expects the kernel image and initramfs to be located in the /boot folder so let's create some + # symlinks in /boot that point to where kernel-install will store the kernel image and initramfs. + if "bios" in args.boot_protocols: + for kver, _ in gen_kernel_images(args, root): + boot_dir = Path("/") / boot_directory(args, kver) + root.joinpath(f"boot/vmlinuz-{kver}").symlink_to(boot_dir / "linux") + root.joinpath(f"boot/initramfs-{kver}.img").symlink_to(boot_dir / "initrd") + @complete_step("Installing openSUSE…") def install_opensuse(args: MkosiArgs, root: Path, do_run_build_script: bool) -> None: @@ -7201,11 +7209,6 @@ def run_kernel_install(args: MkosiArgs, root: Path, do_run_build_script: bool, f run_workspace_command(args, root, ["kernel-install", "add", kver, Path("/") / kimg], env=args.environment) - if args.distribution == Distribution.arch and "bios" in args.boot_protocols: - boot_dir = Path("/") / boot_directory(args, kver) - root.joinpath(f"boot/vmlinuz-{kver}").symlink_to(boot_dir / "linux") - root.joinpath(f"boot/initramfs-{kver}.img").symlink_to(boot_dir / "initrd") - @dataclasses.dataclass class BuildOutput: