Received: from disco.pogo.org.uk (disco.pogo.org.uk [93.93.128.62]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 90A35226A61 for <~alpine/users@lists.alpinelinux.org>; Wed, 15 Jan 2025 05:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xwax.org; s=swing; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Cc: Reply-To:In-Reply-To:References:Content-Transfer-Encoding:Content-ID: Content-Description; bh=glpC2b4CxeoS4lzJa1mwRVM7b/3Y6mJw9AM5LAWYrL8=; b=kl+Dk wfupxxJZnUfGtRsMbqngmzsennKofKcgjgqaRRWxt5lDWfa4bnYIIRtWkamDy2hSU0VpQ8yHWNiIU KgkVAabWrMY3FkJIjp6NYOhUyNMrKb4T0VXFPPpXDsnHimDnPsoK4ET3mXZI/GRzCVSyWdfC/nOYr Z6NQ6zBwLt1M=; Received: from cpc93786-hari17-2-0-cust786.20-2.cable.virginm.net ([82.36.99.19] helo=tamla) by disco.pogo.org.uk with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98 (FreeBSD)) (envelope-from ) id 1tXwHg-00000000I92-1D1C for ~alpine/users@lists.alpinelinux.org; Wed, 15 Jan 2025 05:49:44 +0000 Received: from localhost (tamla.localdomain [local]) by tamla.localdomain (OpenSMTPD) with ESMTPA id 7a8a60ec for <~alpine/users@lists.alpinelinux.org>; Wed, 15 Jan 2025 05:49:43 +0000 (GMT) Date: Wed, 15 Jan 2025 05:49:43 +0000 (GMT) From: Mark Hills To: ~alpine/users@lists.alpinelinux.org Subject: Solutions for EFI booting / copying kernels Message-ID: <8f3899df-71b7-6562-7688-7bebc6ac1f94@xwax.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I have a few Alpine systems which use EFI to boot with syslinux. I'd like to improve this setup. The kernel+initramfs are copied to /efi, where syslinux finds them. Invariably, after "apk upgrade" I forget to do this copy, resulting in a system that won't boot. I tried to automate it with kernel-hooks.d; this is run after kernel upgrades: $ cat /etc/kernel-hooks.d/efi.hook cp --verbose --update \ /boot/vmlinuz-* /boot/initramfs-* \ /efi But is buggy because it runs before initramfs is updated (details below.) My own "trigger" on apk upgrade could work, but there's no path I can add one to (they must originate from a package) Regular syslinux (on MBR) reads the ext4 /boot partition; the EFI variant cannot do this, and otherwise that would seem to be the best solution. Perhaps GRUB can, but I like syslinux as it feels straightforward (unlike GRUB) -- Mark $ cat /efi/EFI/syslinux/syslinux.cfg TIMEOUT 20 PROMPT 1 DEFAULT lts LABEL lts LINUX /vmlinuz-lts INITRD /initramfs-lts APPEND root=/dev/vg0/root modules=ext4 quiet $ ls /efi EFI initramfs-lts vmlinuz-lts $ doas apk upgrade [...] (13/17) Upgrading linux-lts (6.6.68-r0 -> 6.6.71-r0) (14/17) Upgrading linux-lts-doc (6.6.68-r0 -> 6.6.71-r0) (15/17) Upgrading linux-lts-dev (6.6.68-r0 -> 6.6.71-r0) [...] Executing busybox-1.36.1-r29.trigger Executing kmod-32-r0.trigger Executing kernel-hooks-0.2-r0.trigger kernel-hooks: executing hook 20-akms.hook (lts, 6.6.71-0, 6.6.68-0) akms: Uninstalling module acpi_call/1.2.2-r0 from kernel 6.6.68-0-lts akms: Building module acpi_call/1.2.2-r0 for kernel 6.6.71-0-lts make: Entering directory '/usr/src/linux-headers-6.6.71-0-lts' CC [M] /var/lib/akms/6.6.71-0-lts/acpi_call/1.2.2-r0/build/acpi_call.o MODPOST /var/lib/akms/6.6.71-0-lts/acpi_call/1.2.2-r0/build/Module.symvers CC [M] /var/lib/akms/6.6.71-0-lts/acpi_call/1.2.2-r0/build/acpi_call.mod.o LD [M] /var/lib/akms/6.6.71-0-lts/acpi_call/1.2.2-r0/build/acpi_call.ko make: Leaving directory '/usr/src/linux-headers-6.6.71-0-lts' akms: Installing module acpi_call 1.2.2-r0 for kernel 6.6.71-0-lts akms: Module acpi_call/1.2.2-r0 for 6.6.71-0-lts installed successfully kernel-hooks: executing hook efi.hook (lts, 6.6.71-0, 6.6.68-0) + cp --verbose --update /boot/vmlinuz-lts /boot/initramfs-lts /efi '/boot/vmlinuz-lts' -> '/efi/vmlinuz-lts' Executing akms-0.2.1-r0.trigger Executing ca-certificates-20241121-r1.trigger Executing gtk-update-icon-cache-3.24.43-r0.trigger Executing desktop-file-utils-0.27-r0.trigger Executing mkinitfs-3.10.1-r0.trigger ==> initramfs: creating /boot/initramfs-lts for 6.6.71-0-lts Executing mandoc-apropos-1.14.6-r13.trigger Executing syslinux-6.04_pre1-r15.trigger /boot is device /dev/nvme0n1p2 Executing texinfo-7.1-r1.trigger OK: 5847 MiB in 1489 packages