Hello. I have in my /etc/default/grub file the following line: GRUB_PRELOAD_MODULES="lvm diskfilter raid5rec mdraid1x part_gpt ext2" With sys-boot/grub-2.00_p5107-r2 the resulting grub.cfg had these lines: insmod part_gpt insmod part_gpt insmod part_gpt insmod part_gpt insmod diskfilter insmod mdraid1x insmod ext2 With sys-boot/grub-2.02_beta2 I get these lines instead: insmod part_gpt gpt gpt gpt insmod diskfilter mdraid1x insmod ext2 There is no such module as "gpt" and also there is an extra trailing space in the end of "insmod part_gpt gpt gpt gpt" line. Reproducible: Always
Created attachment 384450 [details] emerge --info grub
Created attachment 384452 [details] /etc/default/grub Example grub config
Your config file for 2.00 is pretty broken too; part_gpt should not show up 4 times. Also I am unable to reproduce this with 2.02_beta2. I get the following output in my config file. ### BEGIN /etc/grub.d/00_header ### insmod lvm insmod diskfilter insmod raid5rec insmod mdraid1x insmod part_gpt insmod ext2
(In reply to Mike Gilbert from comment #3) > Your config file for 2.00 is pretty broken too; part_gpt should not show up > 4 times. Indeed. At least it insmod's proper module. > Also I am unable to reproduce this with 2.02_beta2. I get the following > output in my config file. > > ### BEGIN /etc/grub.d/00_header ### > insmod lvm > insmod diskfilter > insmod raid5rec > insmod mdraid1x > insmod part_gpt > insmod ext2 Can you please share you /etc/default/grub file?
Created attachment 384472 [details] floppym's /etc/default/grub Here you go.
(In reply to Coacher from comment #4) > (In reply to Mike Gilbert from comment #3) > > Your config file for 2.00 is pretty broken too; part_gpt should not show up > > 4 times. > > Indeed. At least it insmod's proper module. > > > Also I am unable to reproduce this with 2.02_beta2. I get the following > > output in my config file. > > > > ### BEGIN /etc/grub.d/00_header ### > > insmod lvm > > insmod diskfilter > > insmod raid5rec > > insmod mdraid1x > > insmod part_gpt > > insmod ext2 > > Can you please share you /etc/default/grub file? *insmods *your
(In reply to Mike Gilbert from comment #5) > Created attachment 384472 [details] > floppym's /etc/default/grub > > Here you go. Ok. Here is what I've found so far. 1. Trailing space in files/grub.default-3 on line 10. Please kill it. 2. Trailing space after part_gpt in boot sections of grub.cfg is due to prepare_grub_to_access_device() function, which can be found in /usr/share/grub/grub-mkconfig_lib. More specifically, this part is in charge of part_gpt inserted before every boot entry: old_ifs="$IFS" IFS=' ' partmap="`"${grub_probe}" --device $@ --target=partmap`" for module in ${partmap} ; do case "${module}" in netbsd | openbsd) echo "insmod part_bsd";; *) echo "insmod part_${module}";; esac done The problem is with grub2-probe, which returns "gpt " when called like this `grub2-probe --device /dev/sda1 --target=partmap` on my machine. This problem should be fixed in this commit: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=24024dac7f51d3c0df8e1bec63c02d52828de534 3. Lots of "part_gpt"s with 2.00_p5107 and lots of "gpt "s after "part_gpt" with 2.02_beta2 is due to the fact that / is LVM on top of RAID5 with 4 drives and /boot is RAID1 across the same number of drives. grub just spits out 4 "gpt"s altogether because it cannot handle this setup properly. For example, on this machine I have: # grub2-probe --device /dev/md/boot --target=partmap gpt gpt gpt gpt Previously mentioned commit by the looks of it should hopefully fix it as well. Stay tuned while I'll test this commit.
I can confirm that after applying patch from the said commit (+ a couple of extras) I no longer have problems 2 and partially 3. I still get four lines of "insmod part_gpt", but they at least work as opposed to "insmod part_gpt gpt gpt gpt". I guess grub is unaware of RAID setups such as mine. Please add attached patches in tree. Thanks.
Created attachment 384480 [details] grub2-probe: fix -0 option Had to rip out Changelog changes from patch otherwise it won't apply on top of beta2 tarball.
Created attachment 384482 [details, diff] grub2-probe: trailing spaces fix Had to rip out Changelog changes from patch otherwise it won't apply on top of beta2 tarball.
Created attachment 384484 [details, diff] grub2-mkconfig: fix typo Not really needed, but would be nice to add while you're adding previous two. Had to rip out Changelog changes from patch otherwise it won't apply on top of beta2 tarball.
So this has nothing to do with GRUB_PRELOAD_MODULES. Good work finding those patches. Will apply asap.
(In reply to Mike Gilbert from comment #12) > So this has nothing to do with GRUB_PRELOAD_MODULES. Yes. > Good work finding those patches. Will apply asap. Ok, thanks.
Created attachment 384486 [details, diff] grub2-probe: fix -0 option Restore original subject.
Created attachment 384488 [details, diff] grub2-probe: trailing spaces fix Restore original subject.
Created attachment 384490 [details, diff] grub2-mkconfig: fix typo Restore original subject.
Commited as grub-2.02_beta2-r1. Can you please give it a quick test? +*grub-2.02_beta2-r1 (09 Sep 2014) + + 09 Sep 2014; Mike Gilbert <floppym@gentoo.org> +files/2.02_beta2/0001-Makefile + .util.def-Link-grub-ofpathname-with-zfs-libs.patch, +files/2.02_beta2/0002-gru + b-install-support-for-partitioned-partx-loop-devi.patch, + +files/2.02_beta2/0003-Fix-grub-probe-0-option.patch, +files/2.02_beta2/0004-F + ix-partmap-cryptodisk-and-abstraction-handling-in-g.patch, + +files/2.02_beta2/0005-Fix-typo-gettext_print-instead-of-gettext_printf.patch, + +grub-2.02_beta2-r1.ebuild: + Backport several patches to resolve issues with grub-probe and grub-mkconfig. + Bug 522428, thanks to Coacher. +
(In reply to Mike Gilbert from comment #17) > Commited as grub-2.02_beta2-r1. Can you please give it a quick test? I cannot reproduce problems described above with 2.02-beta2-r1, thanks. Can you please also remove trailing space on line 10 in files/grub.default-3 file? It is pointless to have it, though it doesn't affect functionality. By looking at log of git commits in grub repo I've spotted several of them that might be usefult to add as patches as well. Here they are: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=0901e7855f922e770cbfeb58262cb8fded518190 http://git.savannah.gnu.org/cgit/grub.git/commit/?id=d99d2f84166b0f60673d5c0714605a153946c0fc http://git.savannah.gnu.org/cgit/grub.git/commit/?id=c4badfe8363cc41dbedfabaa238b6c8a884e03c8
+*grub-2.02_beta2-r2 (10 Sep 2014) + + 10 Sep 2014; Mike Gilbert <floppym@gentoo.org> + +files/2.02_beta2/0006-change-stop-condition-to-avoid-infinite-loops.patch, + +files/2.02_beta2/0007-Improve-LVM-logical_volumes-string-matching.patch, + +files/2.02_beta2/0008-Fix-an-infinite-loop-in-grub-mkconfig.patch, + +files/2.02_beta2/0009-Fix-incorrect-address-reference-in-btrfs.patch, + +grub-2.02_beta2-r2.ebuild, -grub-2.02_beta2-r1.ebuild: + More backports, bug 522428.
(In reply to Mike Gilbert from comment #19) > +*grub-2.02_beta2-r2 (10 Sep 2014) > + > + 10 Sep 2014; Mike Gilbert <floppym@gentoo.org> > + > +files/2.02_beta2/0006-change-stop-condition-to-avoid-infinite-loops.patch, > + +files/2.02_beta2/0007-Improve-LVM-logical_volumes-string-matching.patch, > + +files/2.02_beta2/0008-Fix-an-infinite-loop-in-grub-mkconfig.patch, > + +files/2.02_beta2/0009-Fix-incorrect-address-reference-in-btrfs.patch, > + +grub-2.02_beta2-r2.ebuild, -grub-2.02_beta2-r1.ebuild: > + More backports, bug 522428. Thanks a lot!