Hi,
I am dipping my toe into Alpine, and got it running on an ancient
netbook with 1G of RAM.
My next and current attempt is to get it to work installed in a
partition on a UEFI multi-boot machine. Being kinda new to both Alpine
and UEFI, I am so far not succeeding.
If I use efibootmgr to create a UEFI boot option for my alpine partion,
it silently fails and falls back to the EFI boot menu.
I installed rEFInd from an old Ubuntu partition on the same machine
(rEFInd does not appear to have made it into Alpine stable) but the
rEFInd Boot Manager does not find and present Alpine as a boot
option.
Has anyone seen an Alpine 3.18 default Syslinux install work on UEFI?
I am grasping at straws at this point,
rss
On Fri, 30 Jun 2023 12:30:34 +0200
Ralf Mardorf <ralf-mardorf@riseup.net> wrote:
> on my new PC I'm forced to use UEFI, since the new Intel GPU doesn't> allow to select CSM, for this reason I migrated from syslinux to grub.> I used syslinux from my Arch Linux install and now I'm using grub from> the Arch Linux install. The pitfalls I experienced booting Alpine were> not related to the grub bootloader.> > It's not that terrible as it does sound. Without all those grub> configs for the configs and automation, it's possible to write a> clean syslinux alike config for grub [1].
Thanks for the reply, this inspired me to push on, and I do have
progress. I am really stuck on getting to an actual UEFI (eventually
default) boot menu item here, as otherwise my kids will never be able
to safely boot this machine. (What happens when a six-year old plays
with UEFI?: mayhem of the destructive kind. Seen it with my own eyes.
;-)
So I am currently getting Alpine started with rEFInd, which I believe
will not achieve the above default boot objective. Here are my notes,
for posterity and perhaps further comment:
--------------------
Do a surgical single-partition install of Alpine on an already busy
multi-booting machine, and get it booting via UEFI.
The key bit turned out to be in ref 3:
`If you're going to use EFI, make sure you mount esp partition
on /boot/efi and set BOOTLOADER=grub and USE_EFI=1, and that
grub-efi and efibootmgr are installed before running
setup-disk.`
Where (unspoken!!) `BOOTLOADER=grub and USE_EFI=1` are actually
environment variables which must be set prior to running setup-disk.
There were then promising "EFI" messages as setup-disk did it's stuff,
AND a couple of dodgy looking error messages about not being able to
write files to odd looking locations in the EFI partition.
This STILL somehow did not result in a working UEFI boot entry, but
rEFInd (already installed during earlier struggles) picked it up and is
how I currently boot Alpine.
Ref 5 says this:
`Note: The loader and initrd file arguments are relative to the
EFI partition. In a default installation, alpine places these
files in /boot/, while EFI is mounted to /boot/efi/. You can
either update fstab to mount EFI at /boot/, or manually copy
them to /boot/efi/.`
But, I have tried copying initramfs-lts & vmlinuz-lts into /boot/efi/
to no effect, still no working UEFI boot menu item for Alpine. Mounting
the EFI partition on /boot/ makes me nervous, what bad things then
happen to grub?
Refs:
1.
https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html
2. https://wiki.alpinelinux.org/wiki/Installation 3.
https://wiki.alpinelinux.org/wiki/Setting_up_disks_manually 4.
https://wiki.alpinelinux.org/wiki/Dualbooting 5.
https://wiki.alpinelinux.org/wiki/Bootloaders
Hi Ralf,
I know I’m a bit later with this response, but you don’t have to use
Grub for UEFI. Actually, you don’t need any extra bootloader on UEFI.
Linux kernel supports EFISTUB booting which allows EFI firmware to load
the kernel as an EFI executable. The best way is to build EFI Unified
Kernel Image – a single EFI PE executable combining an EFI stub loader,
a kernel image (vmlinuz), the kernel command line, and optionally an
initramfs image, CPU microcode update, and a splash image. This can be
easily signed for Secure Boot. It’s described on
https://wiki.alpinelinux.org/wiki/UEFI_Secure_Boot.
Jakub
On 03/07/23 12:12, RSS wrote:
> On Fri, 30 Jun 2023 12:30:34 +0200> Ralf Mardorf <ralf-mardorf@riseup.net> wrote:> >> on my new PC I'm forced to use UEFI, since the new Intel GPU doesn't>> allow to select CSM, for this reason I migrated from syslinux to grub.>> I used syslinux from my Arch Linux install and now I'm using grub from>> the Arch Linux install. The pitfalls I experienced booting Alpine were>> not related to the grub bootloader.>>>> It's not that terrible as it does sound. Without all those grub>> configs for the configs and automation, it's possible to write a>> clean syslinux alike config for grub [1].> > Thanks for the reply, this inspired me to push on, and I do have> progress. I am really stuck on getting to an actual UEFI (eventually> default) boot menu item here, as otherwise my kids will never be able> to safely boot this machine. (What happens when a six-year old plays> with UEFI?: mayhem of the destructive kind. Seen it with my own eyes.> ;-)> > So I am currently getting Alpine started with rEFInd, which I believe> will not achieve the above default boot objective. Here are my notes,> for posterity and perhaps further comment:> > --------------------> > Do a surgical single-partition install of Alpine on an already busy> multi-booting machine, and get it booting via UEFI.> > The key bit turned out to be in ref 3:> > `If you're going to use EFI, make sure you mount esp partition> on /boot/efi and set BOOTLOADER=grub and USE_EFI=1, and that> grub-efi and efibootmgr are installed before running> setup-disk.`> > Where (unspoken!!) `BOOTLOADER=grub and USE_EFI=1` are actually> environment variables which must be set prior to running setup-disk.> There were then promising "EFI" messages as setup-disk did it's stuff,> AND a couple of dodgy looking error messages about not being able to> write files to odd looking locations in the EFI partition.> > This STILL somehow did not result in a working UEFI boot entry, but> rEFInd (already installed during earlier struggles) picked it up and is> how I currently boot Alpine.> > Ref 5 says this:> > `Note: The loader and initrd file arguments are relative to the> EFI partition. In a default installation, alpine places these> files in /boot/, while EFI is mounted to /boot/efi/. You can> either update fstab to mount EFI at /boot/, or manually copy> them to /boot/efi/.`> > But, I have tried copying initramfs-lts & vmlinuz-lts into /boot/efi/> to no effect, still no working UEFI boot menu item for Alpine. Mounting> the EFI partition on /boot/ makes me nervous, what bad things then> happen to grub?> > Refs:> > 1.> https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html> 2. https://wiki.alpinelinux.org/wiki/Installation 3.> https://wiki.alpinelinux.org/wiki/Setting_up_disks_manually 4.> https://wiki.alpinelinux.org/wiki/Dualbooting 5.> https://wiki.alpinelinux.org/wiki/Bootloaders
> I know I’m a bit later with this response, but you don’t have to use > Grub for UEFI. Actually, you don’t need any extra bootloader on UEFI.> > Linux kernel supports EFISTUB booting which allows EFI firmware to> load the kernel as an EFI executable. The best way is to build EFI> Unified Kernel Image – a single EFI PE executable combining an EFI> stub loader, a kernel image (vmlinuz), the kernel command line, and> optionally an initramfs image, CPU microcode update, and a splash> image. This can be easily signed for Secure Boot. It’s described on > https://wiki.alpinelinux.org/wiki/UEFI_Secure_Boot.
Thanks much for that pointer to this Wiki page, not sure why that did
not turn up in my searches. In fact, the process is not too long or
difficult or all, I just was stumped for a while near the end when
# efibootmgr --disk <dev> --part 1 --create --label 'Alpine
Linux' --load /Alpine/linux-lts.efi --verbose
silently refused to do anything. Weird, because I rebooted into Ubuntu
20.04 and ran the exact same command, and it worked. So it looks like
Alpine is a go on this machine, though I wonder if UEFI is entirely
healthy.