maximbaz / arch-secure-boot

UEFI Secure Boot for Arch Linux + btrfs snapshot recovery
ISC License
126 stars 8 forks source link

Set correct partition for efibootmgr #3

Closed xenrox closed 3 years ago

xenrox commented 3 years ago

Hello,

I just tried out arch-secure-boot since it seems like a lightweight alternative to grub - very nice idea! After a reboot the boot entry vanished. At the moment add-efi does not really work because efibootmgr sets the partition to 1 even if you pass it with -d. So I used bash expansion to extract the partition number and for my use cases it works quite well now but I am not quite sure this covers every edge case.

maximbaz commented 3 years ago

Hi, thanks for the feedback and the PR!

Just out of curiosity, could you show me what do findmnt -n -o SOURCE -T "$ESP" and fdisk -l return in your case? I wonder why I never hit this bug...

xenrox commented 3 years ago

debug.txt I added efibootmgr -v as well. secure-boot-linux is the unpatched version which will vanish after a reboot and secure-boot-linux-debug is patched.

maximbaz commented 3 years ago

Thanks! Very interesting. Out of curiosity, I see your ESP partition is marked as Linux filesystem (and in my case it is EFI System), is it formatted in FAT32 and it's just a metadata mismatch, or you actually have a different file system (which I thought is not possible)?

xenrox commented 3 years ago

Yes it is FAT32. The funny thing is, I just reinstalled with your dotfiles since I thought at first that the vanishing boot entry was a user mistake (you wrote in https://github.com/maximbaz/arch-secure-boot/issues/1 that it is tailored to your dotfiles) and after it happened there as well, I started to investigate. I just skimmed over your install skript, but I would guess that this line is wrong: https://github.com/maximbaz/dotfiles/blob/master/install.sh#L115 The correct argument should be --typecode.

maximbaz commented 3 years ago

Hahaha, it's always nice to discover bugs in my own, supposedly tested, scripts 😁 I tried to keep install.sh up-to-date with all the recent changes including move from GRUB, but frankly I never had to install Arch from scratch for almost a year now. Thanks for your finding, I will fix it 👍