https://bugs.kde.org/show_bug.cgi?id=369077

Max McKinney <max.mckin...@icloud.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |max.mckin...@icloud.com

--- Comment #5 from Max McKinney <max.mckin...@icloud.com> ---
I just reproduced this issue while helping someone troubleshoot, and I can
confirm that it still exists in the latest Neon User Edition (5.12.5). In a
nutshell, there is some overlap between Neon and Ubuntu as far as the files
they use on the ESP partition.

When I first installed Neon the EFI/ESP partition looked like this

root@neon-efi:/boot/efi/EFI# ls -lR
.:
total 12
drwx------ 2 root root 4096 Jun 13 00:01 BOOT
drwx------ 2 root root 4096 Jun 12 23:16 neon
drwx------ 3 root root 4096 Jun 13 02:07 ubuntu

./BOOT:
total 1252
-rwx------ 1 root root 1196736 Jun 13 00:01 BOOTX64.EFI
-rwx------ 1 root root   79856 Jun 13 00:01 fbx64.efi

./neon:
total 3412
-rwx------ 1 root root     126 Jun 13 00:58 grub.cfg
-rwx------ 1 root root 1133944 Jun 13 00:58 grubx64.efi
-rwx------ 1 root root 1153336 Jun 13 00:58 mmx64.efi
-rwx------ 1 root root 1196736 Jun 13 00:58 shimx64.efi

./ubuntu:
total 76
drwx------ 2 root root  4096 Jun 12 23:53 fw
-rwx------ 1 root root 67536 Jun 12 23:53 fwupx64.efi
-rwx------ 1 root root   126 Jun 12 23:53 grub.cfg

./ubuntu/fw:
total 0

At this point Ubuntu wasn't installed yet, so I found it a bit odd that there
was already an ubuntu directory with a grub.cfg but no EFI binaries. The
grub.cfg in the ubuntu directory was exactly the same as the one in the neon
directory. Both looked like this:

search.fs_uuid 29462c84-402a-4111-8f66-bf30fc0caca5 root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

Basically just a pointer to my grub.cfg in the Neon root file system at
/boot/grub/grub.cfg.

efibootmgr looked like this

root@neon-efi:/boot/efi/EFI# efibootmgr -v
BootCurrent: 0003
BootOrder: 0003,0000,0001,0002
Boot0000* EFI DVD/CDROM PciRoot(0x0)/Pci(0x1,0x1)/Ata(1,0,0)
Boot0001* EFI Hard Drive    PciRoot(0x0)/Pci(0xd,0x0)/Sata(0,0,0)
Boot0002* EFI Internal Shell   
MemoryMapped(11,0x2100000,0x28fffff)/FvFile(7c04a583-9e3e-4f1c-ad65-e05268d0b4d1)
Boot0003* neon 
HD(1,GPT,ca5c06d9-47c0-4d84-a568-a61cbfcc6d5d,0x800,0x100000)/File(\EFI\neon\shimx64.efi)

>From this you can see that Neon is using the /boot/efi/EFI/neon directory, so
it would be logical to assume that it's also using the grub.cfg in that same
directory. This is NOT actually the case though. I took a look at
/boot/efi/EFI/neon/grubx64.efi with hexdump and noticed that it uses the Ubuntu
directory on the ESP partition:

root@neon-efi:/boot/efi/EFI/neon# hexdump -C ./grubx64.efi
...
001137d0  03 00 00 00 18 00 00 00  2f 45 46 49 2f 75 62 75  |......../EFI/ubu|
001137e0  6e 74 75 00 00 00 00 00  00 00 00 00 00 00 00 00  |ntu.............|
...

The string "/EFI/neon" doesn't appear anywhere in the file. Jonathan mentioned
above that this is because they are using Ubuntu's grub build which contains
hard coded paths and is digitally signed. Unfortunately this causes some
serious problems if another Ubuntu based distribution is installed.

I installed Kubuntu and the Kubuntu grub menu took over and wouldn't go away
(same problem other have reported above). No combination of grub-install,
grub-update, or reinstalling grub packages would bring back the Neon Grub menu.
I could see that Ubuntu had replaced the grub.cfg file in /boot/efi/EFI/ubuntu/
with its own version that looked like this.

search.fs_uuid 26b73c4e-f909-4279-b5c2-d5f4c6697f60 root hd0,gpt4 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

Now it contains the partition number and file system UUID of my Kubuntu root
partition, which is why I always get the Kubuntu grub menu even when Neon's
grub binary is selected. The grub.cfg in the /boot/efi/EFI/neon directory was
still correct, but it doesn't appear to even be used by Neon's grubx64.efi
binary.

I went ahead and overwrote the grub.cfg in the ubuntu directory with the one
from the neon directory, and that solved the problem. The normal Neon grub menu
is back.

Unfortunately copying that config back into place isn't a perfect solution
since Kubuntu is likely to overwrite it again at some point. Also, if I want to
get rid of Kubuntu and go back to just Neon I'd need to be aware that the
Ubuntu grub.cfg file needs to be manually replaced with the one from the Neon
directory.

There is no way to "fix" Neon's Grub menu that I could find short of manually
changing EFI/ubuntu/grub.cfg to point to the Neon partition/fs. Most people
would expect grub-install to be able to handle this, but it since it doesn't
modify the grub.cfg in EFI/ubuntu it can't fix this issue on its own.

I understand that getting new signed Grub binaries would be a pain, but the
current situation basically breaks grub-install and could easily lead to an
unbootable system if someone were to delete their secondary Ubuntu based OS.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to