Received: from griffin.geeknet.cz (griffin.geeknet.cz [94.142.237.48]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 00C102235C0 for <~alpine/users@lists.alpinelinux.org>; Mon, 3 Jul 2023 10:46:26 +0000 (UTC) Received: by griffin.geeknet.cz (OpenSMTPD) with ESMTP id e6e5de8f; Mon, 3 Jul 2023 12:46:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=jirutka.cz; h=message-id :date:mime-version:subject:to:references:from:in-reply-to :content-type:content-transfer-encoding; s=dk2022; bh=qZmYGkdsKL cUyEI1v6TbORteZs+Pfz4TNrpST+N99pw=; b=jHMkKnllYAyJheZ3itroGq/nNg pEJacNm4YwTv3SReCqVUY3uc4g+Iz15GFuTnxLNvsEdoAZ6x5lL4smgwShX8A3hn wan6qjhGXgHqNl84bVSWtbUyztCrr5GHMDA++SjFwdhM9O89F0yD0haXhngDJ+EF uFgvKir1bzsQNT4n/RWVnEzCRrQcRK/GmIXUOEY1lTKjEDp0I8cCl7j6kvyCbxLQ DkwXUVIVGLPDrnMw2sQynH5dls3pA4AdAZz0QKp+ZpI7Hjt9J2LepQcXdPFW7vpW Qdc0D6OYpAZ9zvusBuSp9mIGCLJ+w9NtwvXWcXA9t8ekBNGbJR0fpv+vN8Og== Received: by griffin.geeknet.cz (OpenSMTPD) with ESMTPSA id 830dca72 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 3 Jul 2023 12:46:24 +0200 (CEST) Message-ID: <910f650e-326e-5773-686a-03cd2474c482@jirutka.cz> Date: Mon, 3 Jul 2023 12:46:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Cannot boot 3.18 with UEFI? Content-Language: cs To: RSS , ~alpine/users@lists.alpinelinux.org References: <20230630174332.4b38d6d5@nixosX240> <6b9ae3e080c1c10450061f715291a76670343e13.camel@riseup.net> <20230703181206.720d6ad6@armor-mail.com> From: Jakub Jirutka In-Reply-To: <20230703181206.720d6ad6@armor-mail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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