~alpine/users

4 4

GRUB 2.12 hell on x86_64

Details
Message ID
<20240104203052.36f29d01@blueselene.com>
DKIM signature
missing
Download raw message
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"·.

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=/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äs, 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

-- 
Current PGP KeyID: 0AFB427F1800FD89751C4035292228735AE707FF

https://blueselene.com/pgp-archive/0AFB427F1800FD89751C4035292228735AE707FF/key.pub
Konstantin Kulikov <k.kulikov2@gmail.com>
Details
Message ID
<CAD+eXGRQtrRh7nHam+_mN59mj=j=cvjnDJAjhA43-APH_PU2DA@mail.gmail.com>
In-Reply-To
<20240104203052.36f29d01@blueselene.com> (view parent)
DKIM signature
missing
Download raw message
Looking at upgrade MR[1] here's what i want to say - switch to
limine[2]. There is no reason for a bootloader to require 20+ patches
to work.

[1]: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/57927/diffs
[2]: https://github.com/limine-bootloader/limine/

On Thu, Jan 4, 2024 at 10:31 PM Alex <alex@blueselene.com> wrote:
>
> 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"·.
>
> 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=/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äs, 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
>
> --
> Current PGP KeyID: 0AFB427F1800FD89751C4035292228735AE707FF
>
> https://blueselene.com/pgp-archive/0AFB427F1800FD89751C4035292228735AE707FF/key.pub
Страхиња Радић <contact@strahinja.org>
Details
Message ID
<2skqqfcdcbr7wlf6wsesxgvu47lmclnc6agwlxeyi7pt2lhn6v@xhaoprth6mgy>
In-Reply-To
<20240104203052.36f29d01@blueselene.com> (view parent)
DKIM signature
missing
Download raw message
With any distro:

- If you want normie-friendly stability without reading on-screen output and 
  prompts, avoid "edge"/"rolling release"/"unstable" and use the "stable" 
  variants.

- If you are using hardcore edge/rolling release/unstable, be hardcore: pay 
  attention when upgrading and have a boot medium handy, just in case.
Details
Message ID
<160741c4-ba15-49ee-9d24-17052e4d8224@mailbox.org>
In-Reply-To
<2skqqfcdcbr7wlf6wsesxgvu47lmclnc6agwlxeyi7pt2lhn6v@xhaoprth6mgy> (view parent)
DKIM signature
missing
Download raw message
This is decent advice, although not the wording I would use.

Totally off-topic: I like using Edge to have up-to-date packages, but I am definitely a "normie" by most standards because I have never bothered with chroot when I muck something up and just use it as an excuse to reinstall.

I'm glad OP sent a message though. I didn't have any SystemRescue disc ready and now I do.

Also, thanks to the Alpine team, happy new year, etc.
Details
Message ID
<d51724c37cbd8134040ce2b75b5223a4f5084e84.camel@riseup.net>
In-Reply-To
<160741c4-ba15-49ee-9d24-17052e4d8224@mailbox.org> (view parent)
DKIM signature
missing
Download raw message
On Fri, 2024-01-05 at 12:38 +0100, Bobby Hiltz wrote:
> I didn't have any SystemRescue disc ready and now I do.

Any USB stick with a live Linux is suitable. Just have a few USB Ventoy
sticks [ https://www.ventoy.net/en/index.html ] (aged 1 or 2 GiB sticks,
for EUR 1,-) with few live Linux lying around, and you're all set.
Reply to thread Export thread (mbox)