Running eclean-kernel -n 2 should remove old kernels and then rebuild grub.cfg but since update to sys-boot/grub-2.00_p5107-r1 this no longer works properly e.g. linux-3.11.1-gentoo # eclean-kernel -n 2 * Removing kernel 3.10.9-gentoo (not referenced by bootloader (symlinks)) - /boot/vmlinuz-3.10.9-gentoo - /boot/System.map-3.10.9-gentoo - /boot/config-3.10.9-gentoo - /lib64/modules/3.10.9-gentoo - /usr/src/linux-3.10.9-gentoo Removed 1 kernels zlink1 linux-3.11.1-gentoo # ls -l /boot/grub total 40 drwxr-xr-x 2 root root 4096 Sep 9 10:26 fonts -rw------- 1 root root 11417 Sep 9 14:17 grub.cfg -rw-r--r-- 1 root root 1024 Sep 9 10:26 grubenv drwxr-xr-x 2 root root 12288 Sep 9 14:16 i386-pc drwxr-xr-x 2 root root 4096 Sep 9 10:26 locale drwxr-xr-x 3 root root 4096 Sep 9 10:26 themes zlink1 linux-3.11.1-gentoo # ls -l boot ls: cannot access boot: No such file or directory zlink1 linux-3.11.1-gentoo # ls -l /boot total 18356 -rw-r--r-- 1 root root 3329527 Sep 7 11:37 System.map-3.11.0-gentoo -rw-r--r-- 1 root root 3329527 Sep 16 07:12 System.map-3.11.1-gentoo lrwxrwxrwx 1 root root 1 Aug 26 2011 boot -> . -rw-r--r-- 1 root root 102037 Sep 7 11:37 config-3.11.0-gentoo -rw-r--r-- 1 root root 102037 Sep 16 07:12 config-3.11.1-gentoo drwxr-xr-x 6 root root 4096 Sep 9 14:17 grub -rw-r--r-- 1 root root 5939776 Sep 7 11:37 vmlinuz-3.11.0-gentoo -rw-r--r-- 1 root root 5939712 Sep 16 07:12 vmlinuz-3.11.1-gentoo zlink1 linux-3.11.1-gentoo # grub2-mkconfig -o /boot/grub/grub.cfg Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.11.1-gentoo Found linux image: /boot/vmlinuz-3.11.0-gentoo Found Gentoo Base System release 2.2 on /dev/sda1 done zlink1 linux-3.11.1-gentoo # ls -l /boot/grub total 40 drwxr-xr-x 2 root root 4096 Sep 9 10:26 fonts -rw------- 1 root root 10096 Sep 16 07:15 grub.cfg -rw-r--r-- 1 root root 1024 Sep 9 10:26 grubenv drwxr-xr-x 2 root root 12288 Sep 9 14:16 i386-pc drwxr-xr-x 2 root root 4096 Sep 9 10:26 locale drwxr-xr-x 3 root root 4096 Sep 9 10:26 themes zlink1 linux-3.11.1-gentoo # emerge --info not included as it is irrelevant in this case script needs an update to check for correct grub/grub2 directory before issuing config (grub.cfg) rebuild command internally. Reproducible: Always
note: earlier testing showed if the /boot/grub2 directory is present it gets updated .. but not the new /boot/grub directory used by >=sys-boot/grub-2.00_p5107-r1 .. thus we boot only old kernels .. until they are removed and then .. unless manually running "grub2-mkconfig -o /boot/grub/grub.cfg" because we noticed the script not showing the grub.cfg rebuild happening as it did previously
I don't use grub, so you need to help me a bit understand what's going on. Do I understand correctly that starting with sys-boot/grub-2.00_p5107-r1, /boot/grub is the correct location? What happens with the old directory? Does it get removed, or...? Could you suggest a way of finding out the correct directory without checking installed package version?
(CC-ing grub2 maint)
The old directory still exists by default but .. the newversion of grub looks at the newer version only? I think .. On my own machines I've removed the old grub2 directories and all runs fine perhaps removal of the grub2 directory and generation of a symlink from /boot/grub2-> /boot/grub (real directory) could be used as a work arround until all versions of grub have migrated to the "new standard"
(In reply to Michał Górny from comment #2) > I don't use grub, so you need to help me a bit understand what's going on. > Do I understand correctly that starting with sys-boot/grub-2.00_p5107-r1, > /boot/grub is the correct location? > Yes. Renaming it wasn't necessary, and actually broke some third party tools. > What happens with the old directory? Does it get removed, or...? Could you > suggest a way of finding out the correct directory without checking > installed package version? The old grub2 directory remains; it isn't safe to remove it until the user has run grub2-install with >=sys-boot/grub-2.00_p5107-r1. I would probably just check for the existence /boot/grub/grub.cfg, followed by /boot/grub2/grub.cfg, and regenerate the first one you find. Also, I should point out that grub2-mkconfig is not always called grub2-mkconfig. If you disable the "mulitslot" use flag, it becomes grub-mkconfig (the default upstream name). Any chance you could implement similar logic for that?
(In reply to Mike Gilbert from comment #5) > I would probably just check for the existence /boot/grub/grub.cfg, followed > by /boot/grub2/grub.cfg, and regenerate the first one you find. I do, but then I assume grub1 is installed. Now I guess I need a better check for grub2. > Also, I should point out that grub2-mkconfig is not always called > grub2-mkconfig. If you disable the "mulitslot" use flag, it becomes > grub-mkconfig (the default upstream name). Any chance you could implement > similar logic for that? This is something secondary, so there should be no issue with with trying grub2-mkconfig first and falling back to grub-mkconfig.
(In reply to Michał Górny from comment #6) > (In reply to Mike Gilbert from comment #5) > > I would probably just check for the existence /boot/grub/grub.cfg, followed > > by /boot/grub2/grub.cfg, and regenerate the first one you find. > > I do, but then I assume grub1 is installed. Now I guess I need a better > check for grub2. > grub:0 reads /boot/grub/menu.lst and/or /boot/grub/grub.conf grub:2 reads /boot/grub/grub.cfg
08440a1 Update the list of grub & grub2 configuration paths. Could you try -9999?
Ping. Can I get a confirmation that the fix works?
so far it does not seem to create a new grub.cfg file .. at least it does not show that is doing so as it did before .. did you make it silent ..? I did not check for the files directly at this last upgrade to kernel 3.11.5 .. but a quick change to the kernel and a reinstall .. running eclean-kernel-9999 does not regenerate grub.cfg ..
it does detect the correct bootloader and config file, but doesn't run "grub2-mkconfig -o /boot/grub/grub.cfg" eclean-kernel --all --exclude=config --ask --debug * Trying bootloader lilo * Trying bootloader grub2 ** /boot/grub/grub.cfg found * Trying bootloader grub * Trying bootloader yaboot * Trying bootloader symlinks * In get_removal_list() Preserving currently running kernel (3.11.5) Remove 3.11.3 (not referenced by bootloader (symlinks))? [Yes/No]y * Removing kernel 3.11.3 (not referenced by bootloader (symlinks)) - /boot/vmlinuz-3.11.3 - /boot/System.map-3.11.3 - /boot/initramfs-3.11.3.img - /lib64/modules/3.11.3 - /usr/src/linux-3.11.3 Remove 3.11.4 (not referenced by bootloader (symlinks))? [Yes/No]n Remove 3.10.14 (not referenced by bootloader (symlinks))? [Yes/No]n Removed 1 kernels app-admin/eclean-kernel-9999 was built with the following: USE="" PYTHON_TARGETS="python2_7 python3_2 -pypy2_0 -python2_6 -python3_3"
Thanks for the debug output. Commit d9ec90f should fix the issue now, please re-test.
yes it now generates /boot/grub/grub.cfg .. thank you for your work on this issue.
@poncho, could you confirm as well? I will wrap up a release afterwards.
(In reply to Michał Górny from comment #14) > @poncho, could you confirm as well? I will wrap up a release afterwards. yes, /boot/grub/grub.cfg gets updated. eclean-kernel --all --exclude=config --ask --debug * Trying bootloader lilo * Trying bootloader grub2 ** /boot/grub/grub.cfg found * In get_removal_list() ** Config is autogenerated, ignoring Preserving currently running kernel (3.11.5) Remove 3.11.5.old (not referenced by bootloader (grub2))? [Yes/No]yes * Removing kernel 3.11.5.old (not referenced by bootloader (grub2)) - /boot/vmlinuz-3.11.5.old - /boot/System.map-3.11.5.old Remove 3.10.14 (not referenced by bootloader (grub2))? [Yes/No]no Remove 3.11.4 (not referenced by bootloader (grub2))? [Yes/No]no Removed 1 kernels * Calling grub2-mkconfig Generating grub.cfg ... File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6394: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6394: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6401: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6401: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6406: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6406: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6416: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6416: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6427: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6427: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6458: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6458: /usr/sbin/grub2-probe Found linux image: /boot/vmlinuz-3.11.5 Found initrd image: /boot/initramfs-3.11.5.img File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6545: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6545: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6551: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6551: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6557: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6557: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6563: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6563: /usr/sbin/grub2-probe Found linux image: /boot/vmlinuz-3.11.4 Found initrd image: /boot/initramfs-3.11.4.img Found linux image: /boot/vmlinuz-3.10.14 Found initrd image: /boot/initramfs-3.10.14.img File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6897: /usr/sbin/grub2-probe File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6897: /usr/sbin/grub2-probe done the "File descriptor 3 (/root/.config/eclean-kernel.rc) leaked on vgs invocation. Parent PID 6394: /usr/sbin/grub2-probe" messages are new though. either related to the new grub or the eclean-kernel git version. cat /root/.config/eclean-kernel.rc --exclude=config --all --ask
+ 15 Oct 2013; Michał Górny <mgorny@gentoo.org> +eclean-kernel-0.4.1.ebuild: + Version bump. The new version fixes finding grub & grub2 configuration files, + bug #485090.