~alpine/users

4 3

Cannot boot 3.18 with UEFI?

Details
Message ID
<20230630174332.4b38d6d5@nixosX240>
DKIM signature
missing
Download raw message
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
Details
Message ID
<6b9ae3e080c1c10450061f715291a76670343e13.camel@riseup.net>
In-Reply-To
<20230630174332.4b38d6d5@nixosX240> (view parent)
DKIM signature
missing
Download raw message
On Fri, 2023-06-30 at 17:43 +0800, RSS wrote:
> Has anyone seen an Alpine 3.18 default Syslinux install work on UEFI?

Hi,

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].

Regards,
Ralf

• rocketmouse@archlinux ~ 
$ cat /boot/grub/grub.cfg
play 1920 440 1 0 1 880 2 0 1 880 1 0 1 440 2
set timeout=60
set color_normal=light-gray/black
set color_highlight=white/light-gray
set menu_color_normal=light-gray/black
set menu_color_highlight=white/light-gray
set default="1"
insmod efi_gop

menuentry " -- HAL 9000-m1 -----------------------------------------------------------------" {
        true
}

menuentry "    MemTest86 V10+ Free" {
        search --set=root --no-floppy --fs-uuid 3F5B-F698
        chainloader /EFI/memtest86/memtestx64.efi
}

menuentry " -- Arch Linux ------------------------------------------------------------------" {
        true
}

menuentry "    Arch Linux threadirqs" {
        search --no-floppy --set=root --label m1.archlinux
        linux /boot/vmlinuz-linux root=/dev/disk/by-label/m1.archlinux ro threadirqs ibt=off ipv6.disable=1
        initrd /boot/intel-ucode.img /boot/initramfs-linux.img
}

menuentry "    Arch Linux" {
        search --no-floppy --set=root --label m1.archlinux
        linux /boot/vmlinuz-linux root=/dev/disk/by-label/m1.archlinux ro ibt=off ipv6.disable=1
        initrd /boot/intel-ucode.img /boot/initramfs-linux.img
}

menuentry "    Arch Linux Longterm" {
        search --no-floppy --set=root --label m1.archlinux
        linux /boot/vmlinuz-linux-lts root=/dev/disk/by-label/m1.archlinux ro ibt=off ipv6.disable=1
        initrd /boot/intel-ucode.img /boot/initramfs-linux-lts.img
}

menuentry "    Arch Linux Rt" {
        search --no-floppy --set=root --label m1.archlinux
        linux /boot/vmlinuz-linux-rt root=/dev/disk/by-label/m1.archlinux ro ibt=off ipv6.disable=1
        initrd /boot/intel-ucode.img /boot/initramfs-linux-rt.img
}

menuentry " -- Other Linux -----------------------------------------------------------------" {
        true
}

menuentry "    Alpine Linux" {
        search --no-floppy --set=root --label m1.alpine
        linux	/boot/vmlinuz-lts root=/dev/disk/by-label/m1.alpine ro modules=ext4
        initrd	/boot/initramfs-lts
}

menuentry "    Xubu 20.04 Linux 6.2.9-custom" {
        search --no-floppy --set=root --label m1.xubu20.04
        linux	/boot/vmlinuz-6.2.9-custom root=/dev/disk/by-label/m1.xubu20.04 ro
        initrd	/boot/initrd.img-6.2.9-custom
}

menuentry "    Ubuntu X Moon Studio lowlatency" {
        search --no-floppy --set=root --label m1.archlinux
        linux   /.boot/ubuntu_moonstudio/boot/vmlinuz-lowlatency root=/dev/disk/by-label/moonstudio ro
        initrd  /.boot/ubuntu_moonstudio/boot/initrd.img-lowlatency
}

submenu "    *buntu            -- Submenu --" {
    menuentry "    Xubu 20.04 Linux 6.2.9-custom     (recovery mode)" {
            search --no-floppy --set=root --label m1.xubu20.04
            linux	/boot/vmlinuz-6.2.9-custom root=/dev/disk/by-label/m1.xubu20.04 ro recovery nomodeset 
            initrd	/boot/initrd.img-6.2.9-custom
    }
    menuentry "    Xubu 20.04 Linux 5.4.0-42-generic" {
            search --no-floppy --set=root --label m1.xubu20.04
            linux	/boot/vmlinuz-5.4.0-42-generic root=/dev/disk/by-label/m1.xubu20.04 ro
            initrd	/boot/initrd.img-5.4.0-42-generic
    }
    menuentry "    Xubu 20.04 Linux 5.4.0-42-generic (recovery mode)" {
            search --no-floppy --set=root --label m1.xubu20.04
            linux	/boot/vmlinuz-5.4.0-42-generic root=/dev/disk/by-label/m1.xubu20.04 ro recovery nomodeset 
            initrd	/boot/initrd.img-5.4.0-42-generic
    }

    menuentry "    Ubuntu X Moon Studio liquorix threadirqs" {
            search --no-floppy --set=root --label m1.archlinux
            linux   /.boot/ubuntu_moonstudio/boot/vmlinuz-liquorix root=/dev/disk/by-label/moonstudio ro threadirqs
            initrd  /.boot/ubuntu_moonstudio/boot/initrd.img-liquorix
    }
}

menuentry " -- System ----------------------------------------------------------------------" {
        true
}

menuentry "    UEFI Firmware Settings" --id 'uefi-firmware' {
        fwsetup
}

menuentry "    Restart" {
        reboot
}

menuentry "    Shutdown" {
        halt
}

menuentry " --------------------------------------------------------------------------------" {
        true
}
Details
Message ID
<20230703181206.720d6ad6@armor-mail.com>
In-Reply-To
<6b9ae3e080c1c10450061f715291a76670343e13.camel@riseup.net> (view parent)
DKIM signature
missing
Download raw message
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
Jakub Jirutka <jakub@jirutka.cz>
Details
Message ID
<910f650e-326e-5773-686a-03cd2474c482@jirutka.cz>
In-Reply-To
<20230703181206.720d6ad6@armor-mail.com> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<20230711165650.2fbfa614@armor-mail.com>
In-Reply-To
<910f650e-326e-5773-686a-03cd2474c482@jirutka.cz> (view parent)
DKIM signature
missing
Download raw message
> 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.
Reply to thread Export thread (mbox)