My laptop is UEFI-booted from a GPT-partitioned internal SSD. I have two Linux systems on it. openSUSE Tumbleweed is my main production system, while another Linux is available as an emergency operating system in case something happens to Tumbleweed. This concept has helped me a lot a few times. For a long time, I had Linux Mint Cinnamon as the 2nd OS. I decided now to try something else in order to get away from the trodden Ubuntu path of outdated software versions and the need for PPAs. After extensive research into Linux distros, I am now trying Manjaro (rolling release concept, up-to-date software, and - putting it simplistically - Arch without the Arch pains).
Tumbleweed shall remain my main production system. Among other things, this means Tumbleweed is responsible for maintaining the GRUB2 bootloader and its configuration as well as boot menu by running
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
every time anything OS-related changes in either of my two systems.
Unfortunately, Tumbleweed currently does not generate correct GRUB2 menu entries for Manjaro via the os-prober.
When I use the Manjaro entries as written from Tumbleweed’s grub2-mkconfig script to /boot/grub2/grub.cfg, booting into Manjaro simply results in Kernel Panic (failure message s.th. like “can’t load VFS file system”; I don’t remember precisely, could reproduce it, but it’s not necessary at this point in time since I know what’s wrong - cf. next paragraph).
By simply comparing the grub.cfg file as written from within Tumbleweed to the one that was written by Manjaro (“for itself”), it is obvious what is going wrong:
/boot/grub/grub.cfg by Manjaro for itself:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Manjaro Linux' --class manjaro --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7b00f0cc-307f-40a2-bff2-a1f767ee15f5' {
savedefault
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7b00f0cc-307f-40a2-bff2-a1f767ee15f5
else
search --no-floppy --fs-uuid --set=root 7b00f0cc-307f-40a2-bff2-a1f767ee15f5
fi
echo 'Loading Linux 4.14.16-1-MANJARO x64 ...'
linux /boot/vmlinuz-4.14-x86_64 root=UUID=7b00f0cc-307f-40a2-bff2-a1f767ee15f5 rw quiet resume=UUID=d0e52c5d-112b-47dc-aa2c-7e1e31e38323
echo 'Loading initial ramdisk ...'
initrd /boot/intel-ucode.img /boot/initramfs-4.14-x86_64.img
}
/boot/grub2/grub.cfg by Tumbleweed’s os-prober for Manjaro:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Manjaro Linux (17.1.4) (auf /dev/sda2)' --class manjarolinux --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-7b00f0cc-307f-40a2-bff2-a1f767ee15f5' {
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 7b00f0cc-307f-40a2-bff2-a1f767ee15f5
else
search --no-floppy --fs-uuid --set=root 7b00f0cc-307f-40a2-bff2-a1f767ee15f5
fi
linuxefi /boot/vmlinuz-4.14-x86_64 root=UUID=7b00f0cc-307f-40a2-bff2-a1f767ee15f5 rw quiet resume=UUID=d0e52c5d-112b-47dc-aa2c-7e1e31e38323
initrdefi /boot/intel-ucode.img
}
The crucial erroneous statement is the last initrd line. Tumbleweed’s os-prober is missing the /boot/initramfs-4.14-x86_64.img after /boot/intel-ucode.img. Just adding the missing piece in the various places both in the main and advanced GRUB2 menu sections results in everything working fine.
Remark: I am not sure about the differences between linux versus linuxefi as well as initrd versus initrdefi. My PC doesn’t have Secure Boot in its UEFI. Whatever the reason was for Manjaro to use linux and initrd only instead of linuxefi and initrdefi (Tumbleweed), I checked that both do work.
Remark 2: My laptop is an HP EliteBook 8560w dating back to 2011. At that time, HP merely had a half-baked UEFI implementation. This requires a /boot/efi/EFI/BOOT/bootx64.efi as the bootloader code (original Microsoft Win 8 style), which is achieved by simply copying and renaming the grubx64.efi files created by the various operating system as /boot/efi/EFI/os-name/grubx64.efi to /boot/efi/EFI/BOOT/bootx64.efi as desired.
My question to the community is: Since it is both undesirable and “forbidden” to edit the /boot/grub.cfg file manually, I would like to get help on how I can get Tumbleweed’s grub2-mkconfig script and the templates from /etc/grub.d as well as the settings from /etc/default/grub to generate correct os-prober entries for Manjaro.
Thanks a lot in advance!