FS#38455 - [grub] 10_archlinux and 10_linux produce duplicate menuentries in grub.cfg
Attached to Project:
Arch Linux
Opened by Zhuoyun Wei (wzyboy) - Saturday, 11 January 2014, 08:41 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 07 April 2014, 16:58 GMT
Opened by Zhuoyun Wei (wzyboy) - Saturday, 11 January 2014, 08:41 GMT
Last edited by Tobias Powalowski (tpowa) - Monday, 07 April 2014, 16:58 GMT
|
Details
Description:
grub version 1:2.02.beta2-1 has a new script /etc/grub.d/10_archlinux. This script along with /etc/grub.d/10_linux will produce duplicate menuentries in grub.cfg, as shown: ### BEGIN /etc/grub.d/10_archlinux ### menuentry "Arch Linux pkg-linux kernel" --class arch-linux --class arch --class gnu-linux --class gnu --class os { [...] } menuentry "Arch Linux pkg-linux kernel (fallback initramfs)" --class arch-linux --class arch --class gnu-linux --class gnu --class os { [...] } ### END /etc/grub.d/10_archlinux ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'Arch Linux, mit Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-218e8912-90d4-4016-9fdd-9850cf1558cd' { [...] } ### END /etc/grub.d/10_linux ### Steps to reproduce: * pacman -S grub * grub-mkconfig * observe the output |
This task depends upon
I do not know how to stop 10_linux from creating menuentries for Arch kernels.
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, mit Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-218e8912-90d4-4016-9fdd-9850cf1558cd' {
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 10e5679d-4e3d-4572-8d6c-adca68ec3800
else
search --no-floppy --fs-uuid --set=root 10e5679d-4e3d-4572-8d6c-adca68ec3800
fi
echo 'Linux linux wird geladen …'
linux /vmlinuz-linux root=UUID=218e8912-90d4-4016-9fdd-9850cf1558cd rw cryptdevice=/dev/sda3:luks-sda3 acpi_backlight=vendor
echo 'Initiale Ramdisk wird geladen …'
initrd /initramfs-linux.img
}
### END /etc/grub.d/10_linux ###
To stop 10_linux from creating entries, just `chmod -x /etc/grub.d/10_linux` will do.
Mine before editing looked like:
Arch Linux pkg-linux kernel
Arch Linux pkg-linux kernel (fallback initramfs)
Arch Linux pkg-ck-linux kernel
Arch Linux pkg-ck-linux kernel (fallback initramfs)
Arch Linux pkg-lqx-linux kernel
Arch Linux pkg-lqx-linux kernel (fallback initramfs)
Arch Linux
Arch Linux Advanced Options
-->Arch Linux with Linux linux
-->Arch Linux pkg-ck-linux kernel
-->Arch Linux pkg-lqx-linux kernel
Arch Linux pkg-linux kernel
Arch Linux pkg-linux kernel (fallback initramfs)
Arch Linux
Arch Linux Advanced Options
Only "Arch Linux" (3rd line) would boot. The "pkg-linux" lines produce "/boot/vmlinux-linux not found" -- note: my boot drive has a btrfs subvolume configuration.
FS#38566which has a patch in it that fixes the issue with BTRFS (at least it did for my system).@Tpowa - I opened a ticket upstream referencing this flyspray since the script in question is provided by them.[1] Can you also take a look at the patch I mentioned in
FS#38566above? That task is currently unassigned and contains a fix that should be considered.1. https://savannah.gnu.org/bugs/index.php?41384
https://wiki.archlinux.org/index.php?title=GRUB&diff=prev&oldid=296042
Please modifie it if not appropriate or this issue is resolved. I'm watching this task, but maybe I miss it.
While grub does produce duplicate entries (as pointed out by op), all of them are effectively same on my system and all work.
PS: Why does 10_archlinux exists in first place? Is not 10_linux enough?
In my case (ext4 on LVM on LUKS on BIOS/MBR), entries generated by 10_linux and 10_archlinux are all functional (didn't try fallback though). Relevant excerpt from /boot/grub/grub.cfg attached.
So that would mean, potentially 10_archlinux isn't needed anymore?
Btw, why does Arch provide the development version of Grub (latest git version from http://git.savannah.gnu.org/cgit/grub.git/) instead of latest stable one, which is referenced on ftp://ftp.gnu.org/gnu/grub/ as being 2.00? Needed to fix something maybe? I couldn't find info about that on arch-dev-public. Just wondering.
Apart from that everything looked fine, with a first standard entry called "Arch linux" and a second one called "Advanced options" opening a submenu with every kernels available (reminder: submenus can be disabled by adding "GRUB_DISABLE_SUBMENU=y" in /etc/default/grub).
Disabling 10_archlinux fixes this bug (redundant entries) for me, but this isn't a perfect fix since fallback entries aren't generated anymore.
My freshly generated GRUB does this:
Arch Linux pkg-linux kernel
Arch Linux pkg-linux kernel (fallback initramfs)
Arch Linux pkg-ck-linux kernel
Arch Linux pkg-ck-linux kernel (fallback initramfs)
Arch Linux pkg-lqx-linux kernel
Arch Linux pkg-lqx-linux kernel (fallback initramfs)
Arch Linux pkg-lts-ck-linux kernel
Arch Linux pkg-lts-ck-linux kernel (fallback initramfs)
Arch Linux pkg-mainline-linux kernel
Arch Linux pkg-mainline-linux kernel (fallback initramfs)
Arch Linux
Arch Linux Advanced Options
-->Arch Linux with Linux linux
-->Arch Linux pkg-ck-linux kernel
-->Arch Linux pkg-lqx-linux kernel
-->Arch Linux pkg-lts-ck-linux kernel
-->Arch Linux pkg-mainline-linux kernel
The last five entries are in a submenu, headed under "Arch Linux Advanced Options". Also, I haven't a clue why there is an "Arch Linux" option, but it works (and boots the [core] kernel).
Also, all the entries work for me.
I've downgraded to grub 2.00.5086-1 because it works (yes, it puts the kernels in reverse alphabetical order, but I'd rather have that because I don't want the extra entries).
/boot/vmlinuz-custom # self compiled from mainline
/boot/initramfs-custom.img # self generated initramfs, with my kernel it is not necessary. I add it for sheer convenience e.g. for things like grub, dm-mod, os-prober
initramfs-fallback.img -> initramfs-linux-fallback.img
initramfs-linux
initramfs-linux-fallback.img
initramfs-linux.img
kernel26-fallback.img -> initramfs-linux-fallback.img
kernel26.img -> initramfs-linux.img
vmlinuz-fallback -> vmlinuz-linux
vmlinuz-linux
vmlinuz26 -> vmlinuz-linux
and # cat /boot/grub/grub.cfg | grep -E 'initrd|linux'
loadfont ($root)/grub/themes/Archlinux/Sans-10.pf2
loadfont ($root)/grub/themes/Archlinux/Sans-12.pf2
loadfont ($root)/grub/themes/Archlinux/Sans-14.pf2
set theme=($root)/grub/themes/Archlinux/theme.txt
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8ffa44c0-d1e5-44bd-9963-9d9671eddab3' {
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=8ffa44c0-d1e5-44bd-9963-9d9671eddab3 rw resume=/dev/sda2 loglevel=4
initrd /initramfs-linux.img
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-8ffa44c0-d1e5-44bd-9963-9d9671eddab3' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-8ffa44c0-d1e5-44bd-9963-9d9671eddab3' {
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=8ffa44c0-d1e5-44bd-9963-9d9671eddab3 rw resume=/dev/sda2 loglevel=4
initrd /initramfs-linux.img
menuentry 'Arch Linux, with Linux fallback' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-fallback-advanced-8ffa44c0-d1e5-44bd-9963-9d9671eddab3' {
linux /vmlinuz-fallback root=UUID=8ffa44c0-d1e5-44bd-9963-9d9671eddab3 rw resume=/dev/sda2 loglevel=4
initrd /initramfs-fallback.img
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
linux16 /memtest86+/memtest.bin
Can we help you in some way? Or should we think about reverting the Arch specific changes in the last package-releases?
the 10_linux does it correct but does not offer fallback options.
the 10_archlinux does nothing correct?
Thanks
For me, 10_archlinux is fully correct (incl. fallback option) and is the default boot option;
10_linux is without fallback option and has some differences to the other entry regarding insmods. Didn't try to boot it, though.
I attached the relevant parts of the grub.cfg
This feature is very useful in multi-boot systems.
Of course, in my opinion, if both of them are provided in grub, both should work correctly.
# chmod -x /etc/grub.d/10_linux
* Default Archlinux with initramfs and initramfs-fallback
* Custom Kernel with custom initramfs (named: vmlinuz-custom, mkinitcpio-custom)
After update:
1. Archlinux with initramfs # okay
2. Archlinux with initramfs (fallback) #okay
3. Archlinux with initrd # false, same as 1
4. Submenu
4.1 Archlinux with initramfs # false, same as 1
4.2 Custom kernel # okay, but should be a top-level
The rootflags= directive is missing from the entry.
Resulting in halting boot with '/sbin/init not found' error