You are not logged in.
Hi,
I'm looking for information on which exact action writes kernel files into /boot such as /boot/vmlinuz-linux.
Context is: I'm using sbctl to produce EFI binaries that are written to /boot/linux.efi and I actually don't need /boot/vmlinuz-linux there and some laptops (cough, cough, Dell) have a super-tiny EFI partition. I'm *not* looking for moving EFI partition to /boot/efi etc.
The only data point I found is this old announcement: https://archlinux.org/news/new-kernel-p … pio-hooks/
> All our official kernels: linux, linux-lts, linux-zen and linux-hardened, do not install the actual kernel to /boot anymore.
> The installation is done by mkinitcpio hooks and scripts, as well as removals.
But I've browsed mkinitcpio hooks and they seem to only handle building initramfs images (which I successfully moved from /boot to some other location).
Kernel packages indeed don't write to /boot (pacman -Ql linux | grep /boot).
`pacman -F /boot/` also doesn't bring any info on that. I've also browsed libalpm hooks (/usr/share/libalpm/hooks/) and read a bit of mkinitcpio source code but it didn't help.
Thanks for your time!
Last edited by wiktor-k (2023-05-25 07:58:03)
Offline
/usr/share/libalpm/scripts/mkinitcpio install_kernel, triggered by /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
Offline
Thanks seth!
It seems from the source of /usr/share/libalpm/hooks/90-mkinitcpio-install.hook that it runs `install` not `install_kernel` but one is probably triggered by another. From my experience just reinstalling the kernel (pacman -S linux) seems to be the best way to trigger hooks in the right order.
Just for completeness sake here's my mkinitcpio file that completely relocates the kernel from /boot:
$ cat /etc/mkinitcpio.d/linux.preset
ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/var/boot/vmlinuz-linux"
PRESETS=('default')
default_image="/var/boot/initramfs-linux.img"
fallback_image="/var/boot/initramfs-linux-fallback.img"
fallback_options="-S autodetect"
And the corresponding sbctl config file:
$ cat /usr/share/secureboot/bundles.db
{
"/boot/linux.efi": {
"output": "/boot/linux.efi",
"intel_microcode": "",
"amd_microcode": "/boot/amd-ucode.img",
"kernel_image": "/var/boot/vmlinuz-linux",
"initramfs": "/var/boot/initramfs-linux.img",
"cmdline": "/etc/kernel/cmdline",
"splash": "/usr/share/systemd/bootctl/splash-arch.bmp",
"os_release": "/usr/lib/os-release",
"efi_stub": "/usr/lib/systemd/boot/efi/linuxx64.efi.stub",
"esp": "/boot"
}
}
Offline