Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 75644225927 for <~alpine/users@lists.alpinelinux.org>; Mon, 20 Jan 2025 18:58:01 +0000 (UTC) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 99E87240027 for <~alpine/users@lists.alpinelinux.org>; Mon, 20 Jan 2025 19:58:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1737399480; bh=JH1PlDLVQUnV2yQaDnCZXhYgMt9ga2y1ICoE7DHWHQQ=; h=Mime-Version:Content-Transfer-Encoding:Content-Type:Date: Message-Id:From:To:Subject:From; b=cLZ76g+j9jCl6PAyyoLpwDws8MuOsZTH/FhdH52cRtOfGcTcjQXTji6W5Dni65GJu 9afyqgfdD+ouQRgR1jR6yqfGfWcMS77ag894npImhAbZRqmiOYVTfT989HvqIgbN87 3M3u1Xl//0Dsc3pUUIOdSodVHB0TC3m+0BDpxo6KahEhG9ygHGsSsYWE3PqEtiL59W Bx9hAzjfxBGAsOSMV30cdlP6EmnSAFZoWftLunyjegvGuVD/kW80ci7SHfCZyMJxF7 EsQNgsm0/14b68D4SgLKp7fsXTVp2cLrch6nxkJz+ONQf1ZR6ydu3pNKDwGkbCKryC 13KvGL570w/dw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YcKNR56x5z9rxD; Mon, 20 Jan 2025 19:57:59 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 20 Jan 2025 18:57:59 +0000 Message-Id: From: "Sertonix" To: "Mark Hills" , <~alpine/users@lists.alpinelinux.org> Subject: Re: Solutions for EFI booting / copying kernels References: <8f3899df-71b7-6562-7688-7bebc6ac1f94@xwax.org> In-Reply-To: <8f3899df-71b7-6562-7688-7bebc6ac1f94@xwax.org> > 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= =20 > system that won't boot. > > I tried to automate it with kernel-hooks.d; this is run after kernel=20 > 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= =20 > one to (they must originate from a package) > > Regular syslinux (on MBR) reads the ext4 /boot partition; the EFI variant= =20 > cannot do this, and otherwise that would seem to be the best solution.=20 > Perhaps GRUB can, but I like syslinux as it feels straightforward (unlike= =20 > GRUB) I think it should work if you mount the EFI partition at /boot instead of /efi. Then there isn't any copying needed. You would need to copy all existing contents of /boot to /efi and then change in /etc/fstab change /efi to /boot. Then you should be able to reboot/upgrade just fine. To clean up the duplicate files you would need to unmount /boot after a reboot and then remove the files that were hidden by the mount (and probably reboot before any upgrade). Be carefull to not delete the wrong file though.