Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id CFAD5225A38 for <~alpine/users@lists.alpinelinux.org>; Thu, 4 Jan 2024 19:31:24 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 79B6AE0005; Thu, 4 Jan 2024 19:31:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blueselene.com; s=gm1; t=1704396683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=6OYz7Ilrg+77JV1U+fiWeSNGeWddfYT+VIIRlOEFD8s=; b=UkfL29fmZO/S74kmVueohHDwnHDUKJ1t5vt9Zzq4o3N7XjeTaKc7QvqZbV182Ioa5wO3Fh icYG222xDPZJatyLy3WG6v1RGXzBaRRLlqW86fwwRSZjTCQCyRUgkgm4eV2mA6s+1DxIf4 st0vpKjWvYyOZPsgE/zfLqN92LZxE6Ui+yKdvgOZJLtNbJV83OzD/k/AxB2MQy8HdWfZce 4EqAB+7Uxr1W0dOrwYSGp6O77JO29s7PpQRsqIrtgHJrwPpA0ljBwmgPc+ToiWvlrqSyIK Za0pUnRWDXDzH0Ped5Ea68xb6LaKxY9/Y+LcFWHFDi8ajAkseICjw04VcjmkKQ== Date: Thu, 4 Jan 2024 20:30:52 +0100 From: Alex To: ~alpine/users@lists.alpinelinux.org Cc: Timo =?UTF-8?B?VGVyw6Rz?= Subject: GRUB 2.12 hell on x86_64 Message-ID: <20240104203052.36f29d01@blueselene.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/=tA2kezvwhQ8KNPi7V0iBtj"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-GND-Sasl: alex@blueselene.com --Sig_/=tA2kezvwhQ8KNPi7V0iBtj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable If you're unlucky like me and, after the GRUB 2.12 upgrade in Edge, you had a non-working GRUB, read on: So, if after an upgrade of GRUB, you boot the computer only to find some text saying "Welcome to GRUB!" flash on the screen and an instant reboot into the UEFI firmware settings, congratulations, your GRUB installation is broken! Hopefully you have an install of SystemRescue handy for this one. Insert your CD/DVD/USB drive with SystemRescue and boot it. We're going to reinstall GRUB. Once on SystemRescue, open a terminal (if using a GUI) and run "mountall". This script mounts all drives on the system and also bind-mounts SystemRescue's /dev, /proc and /sys into the filesystem of your drives if it finds them on the drives[1]. This is a necessary step, so make sure you mount the drives using "mountall"=C2=B7. Next, chroot into your EXT4 (or whatever filesystem you use) partition. Once there, run "mount -a". This will use your /etc/fstab (on your drive) to mount the rest of your filesystems on the chroot, most importantly your boot partition. To reinstall GRUB, run "grub-install --efi-directory=3D/boot/ --no-nvram --disable-shim-lock" in the chroot. --disable-shim-lock is necessary, otherwise GRUB will appear to work, but if you boot into Alpine Linux it will complain about missing "grub_is_shim_lock_enabled" symbols and fail. This I fixed thanks to [2]. Next, you'll want to copy the grubx64.efi file it generates into the alpine and boot folders (for this last one rename it to bootx64.efi). Run "apk fix grub" so that APK regenerates the GRUB configuration just in case. Reboot and you should have a working GRUB once again! At least I did. CCing Timo Ter=C3=A4s, maintainer of GRUB on Alpine, since this should've been handled by APK automatically IMO, without requiring manual intervention like this. [1]: https://www.system-rescue.org/scripts/mountall/ [2]: https://github.com/NixOS/nixpkgs/issues/243026#issuecomment-1644078833 --=20 Current PGP KeyID: 0AFB427F1800FD89751C4035292228735AE707FF https://blueselene.com/pgp-archive/0AFB427F1800FD89751C4035292228735AE707FF= /key.pub --Sig_/=tA2kezvwhQ8KNPi7V0iBtj Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQK+0J/GAD9iXUcQDUpIihzWucH/wUCZZcHbAAKCRApIihzWucH /yjXAQDCFrj7lzYzbu5xoAnXzvxDgj2NJ3jJRHBhvSfT4dd6ngEA2IX1Ddopy4ue qPGlXuwc78ZBUKUYCRemZUuwmx3vbwQ= =lzGE -----END PGP SIGNATURE----- --Sig_/=tA2kezvwhQ8KNPi7V0iBtj--