- Support for Clear Linux was dropped. See https://github.com/systemd/mkosi/pull/1037
for more information.
+- The Arch kernel/bootloader pacman hooks were removed. For anyone that still
+wants to use them, they can be found [here](https://github.com/systemd/mkosi/tree/v13/mkosi/resources/arch).
+When building a bios image, /boot/vmlinuz-kver and /boot/initramfs-kver.img are
+now symlinks to the actual files as installed by kernel-install.
## v13
)
)
- if not do_run_build_script and args.bootable:
- hooks_dir = root / "etc/pacman.d/hooks"
- scripts_dir = root / "etc/pacman.d/scripts"
-
- os.makedirs(hooks_dir, 0o755, exist_ok=True)
- os.makedirs(scripts_dir, 0o755, exist_ok=True)
-
- # Disable depmod pacman hook as depmod is handled by kernel-install as well.
- hooks_dir.joinpath("60-depmod.hook").symlink_to("/dev/null")
-
- write_resource(hooks_dir / "90-mkosi-kernel-add.hook", "mkosi.resources.arch", "90_kernel_add.hook")
- write_resource(scripts_dir / "mkosi-kernel-add", "mkosi.resources.arch", "kernel_add.sh",
- executable=True)
-
- write_resource(hooks_dir / "60-mkosi-kernel-remove.hook", "mkosi.resources.arch", "60_kernel_remove.hook")
- write_resource(scripts_dir / "mkosi-kernel-remove", "mkosi.resources.arch", "kernel_remove.sh",
- executable=True)
-
- if args.get_partition(PartitionIdentifier.esp):
- write_resource(hooks_dir / "91-mkosi-bootctl-update.hook", "mkosi.resources.arch", "91_bootctl_update.hook")
-
- if args.get_partition(PartitionIdentifier.bios):
- write_resource(hooks_dir / "90-mkosi-vmlinuz-add.hook", "mkosi.resources.arch", "90_vmlinuz_add.hook")
- write_resource(hooks_dir / "60-mkosi-vmlinuz-remove.hook", "mkosi.resources.arch", "60_vmlinuz_remove.hook")
-
keyring = "archlinux"
if platform.machine() == "aarch64":
keyring += "arm"
+++ /dev/null
-[Trigger]
-Operation = Upgrade
-Operation = Remove
-Type = Path
-Target = usr/lib/modules/*/vmlinuz
-
-[Action]
-Description = Removing kernel and initramfs images from /boot...
-When = PreTransaction
-Exec = /etc/pacman.d/mkosi-kernel-remove
-NeedsTargets
+++ /dev/null
-[Trigger]
-Operation = Upgrade
-Operation = Remove
-Type = Path
-Target = usr/lib/modules/*/vmlinuz
-
-[Action]
-Description = Removing vmlinuz from /boot...
-When = PreTransaction
-Exec = /bin/bash -c 'while read -r f; do rm -f "/boot/vmlinuz-$(basename "$(dirname "$f")")"; done'
-NeedsTargets
+++ /dev/null
-[Trigger]
-Operation = Install
-Operation = Upgrade
-Type = Path
-Target = usr/lib/modules/*/vmlinuz
-Target = usr/lib/kernel/install.d/*
-Target = boot/*-ucode.img
-
-[Trigger]
-Operation = Install
-Operation = Upgrade
-Type = Package
-Target = systemd
-
-[Action]
-Description = Adding kernel and initramfs images to /boot...
-When = PostTransaction
-Exec = /etc/pacman.d/scripts/mkosi-kernel-add
-NeedsTargets
+++ /dev/null
-[Trigger]
-Operation = Install
-Operation = Upgrade
-Type = Path
-Target = usr/lib/modules/*/vmlinuz
-
-[Action]
-Description = Adding vmlinuz to /boot...
-When = PostTransaction
-Exec = /bin/bash -c 'while read -r f; do install -Dm644 "$f" "/boot/vmlinuz-$(basename "$(dirname "$f")")"; done'
-NeedsTargets
+++ /dev/null
-[Trigger]
-Operation = Upgrade
-Type = Package
-Target = systemd
-
-[Action]
-Description = Updating systemd-boot...
-When = PostTransaction
-Exec = /usr/bin/bootctl update
+++ /dev/null
-#!/bin/bash -e
-shopt -s nullglob
-
-declare -a kernel_version
-
-# Check the targets passed by the pacman hook.
-while read -r line
-do
- if [[ "$line" =~ usr/lib/modules/([^/]+)/vmlinuz ]]
- then
- kernel_version+=( "${BASH_REMATCH[1]}" )
- else
- # If a non-matching line is passed, just rebuild all kernels.
- kernel_version=()
- for f in /usr/lib/modules/*/vmlinuz
- do
- kernel_version+=( "$(basename "$(dirname "$f")")" )
- done
- break
- fi
-done
-
-# (re)build the kernel images.
-for kv in "${kernel_version[@]}"
-do
- kernel-install add "$kv" "/usr/lib/modules/${kv}/vmlinuz"
-done
+++ /dev/null
-#!/bin/bash -e
-
-while read -r f; do
- kernel-install remove "$(basename "$(dirname "$f")")"
-done