Bug 923439 - dracut's 'rescue' kernel is named such that grub2 orders it higher than real kernels
Summary: dracut's 'rescue' kernel is named such that grub2 orders it higher than real ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 19
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: dracut-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-19 20:17 UTC by Adam Williamson
Modified: 2015-01-09 23:43 UTC (History)
4 users (show)

Fixed In Version: dracut-026-72.git20130320
Clone Of:
Environment:
Last Closed: 2015-01-09 23:43:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Adam Williamson 2013-03-19 20:17:11 UTC
The new /etc/kernel/postinst.d/51-dracut-rescue-postinst.sh creates kernels with this kind of filename:

vmlinuz-2000656e56500583cc9b884bb121a7b9-rescue
initramfs-2000656e56500583cc9b884bb121a7b9-rescue.img

To grub, these names order higher than typical Fedora kernel names:

vmlinuz-3.9.0-0.rc3.git0.5.fc20.x86_64
initramfs-3.9.0-0.rc3.git0.5.fc20.x86_64.img

So when I run grub2-mkconfig , I get something like the grub config snippet that comes after this description: note that the 'Fedora' entry is for the rescue kernel, as is the first entry on the 'Advanced options for Fedora' sub-menu. Obviously, we don't want the rescue kernel to be the default when someone runs grub2-mkconfig for any reason (or when the installer does it, if the rescue kernel is present at that point). It should be the last entry in 'Advanced options', ideally.

pjones writes:

<pjones> we're not changing the ordering function; dracut should be doing something smarter about what it creates.

So you get to rename the rescue images such that they will order dependably *after* the real kernels.

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a749ca4b-0cea-4db0-883d-5c036d89e5c5' {
        savedefault
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  a96e9316-f248-44e4-9197-2d686791a8bb
        else
          search --no-floppy --fs-uuid --set=root a96e9316-f248-44e4-9197-2d686791a8bb
        fi
        echo    'Loading Linux 2000656e56500583cc9b884bb121a7b9-rescue ...'
        linux   /vmlinuz-2000656e56500583cc9b884bb121a7b9-rescue root=/dev/mapper/vg_adam-lv_root ro quiet rhgb fbcon=rotate:3 slub_debug=-
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-2000656e56500583cc9b884bb121a7b9-rescue.img
}
submenu 'Advanced options for Fedora' $menuentry_id_option 'gnulinux-advanced-a749ca4b-0cea-4db0-883d-5c036d89e5c5' {
        menuentry 'Fedora, with Linux 2000656e56500583cc9b884bb121a7b9-rescue' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-2000656e56500583cc9b884bb121a7b9-rescue-advanced-a749ca4b-0cea-4db0-883d-5c036d89e5c5' {
        savedefault
                load_video
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  a96e9316-f248-44e4-9197-2d686791a8bb
                else
                  search --no-floppy --fs-uuid --set=root a96e9316-f248-44e4-9197-2d686791a8bb
                fi
                echo    'Loading Linux 2000656e56500583cc9b884bb121a7b9-rescue ...'
                linux   /vmlinuz-2000656e56500583cc9b884bb121a7b9-rescue root=/dev/mapper/vg_adam-lv_root ro quiet rhgb fbcon=rotate:3 slub_debug=-
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-2000656e56500583cc9b884bb121a7b9-rescue.img
        }
        menuentry 'Fedora, with Linux 3.9.0-0.rc2.git0.4.fc20.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.0-0.rc2.git0.4.fc20.x86_64-advanced-a749ca4b-0cea-4db0-883d-5c036d89e5c5' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  a96e9316-f248-44e4-9197-2d686791a8bb
                else
                  search --no-floppy --fs-uuid --set=root a96e9316-f248-44e4-9197-2d686791a8bb
                fi
                echo    'Loading Linux 3.9.0-0.rc2.git0.4.fc20.x86_64 ...'
                linux   /vmlinuz-3.9.0-0.rc2.git0.4.fc20.x86_64 root=/dev/mapper/vg_adam-lv_root ro quiet rhgb fbcon=rotate:3 slub_debug=-
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-3.9.0-0.rc2.git0.4.fc20.x86_64.img
        }
        menuentry 'Fedora, with Linux 3.9.0-0.rc1.git2.1.1.fc19.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.0-0.rc1.git2.1.1.fc19.x86_64-advanced-a749ca4b-0cea-4db0-883d-5c036d89e5c5' {
        savedefault
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  a96e9316-f248-44e4-9197-2d686791a8bb
                else
                  search --no-floppy --fs-uuid --set=root a96e9316-f248-44e4-9197-2d686791a8bb
                fi
                echo    'Loading Linux 3.9.0-0.rc1.git2.1.1.fc19.x86_64 ...'
                linux   /vmlinuz-3.9.0-0.rc1.git2.1.1.fc19.x86_64 root=/dev/mapper/vg_adam-lv_root ro quiet rhgb fbcon=rotate:3 slub_debug=-
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-3.9.0-0.rc1.git2.1.1.fc19.x86_64.img
        }
}

Comment 1 Adam Williamson 2013-03-19 20:17:34 UTC
This may block Alpha if it affects things at install time, I'll try and test that when we have a viable install image.

Comment 2 Harald Hoyer 2013-03-20 09:33:19 UTC
dracut-026-72.git20130320

Comment 3 Maciek Borzecki 2014-02-19 21:14:59 UTC
The problem is still present in F20. Do you need any additional information?

Comment 4 Adam Williamson 2014-02-19 21:17:42 UTC
Yes, because I don't think it is. I've done many, many F20 installs, including one just this morning, and not seen this.

Comment 5 Maciek Borzecki 2014-02-20 11:18:05 UTC
I don't recall problem being in F19, started happening after upgrading to F20 with fedup.

This is what was generated after installing a new kernel (I purposely installed rawhide-nodebug kernel just to show grub config). Contents of /boot/efi/EFI/fedora/grub.cfg:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora 20 Rescue fbb0c4896a9c0f680475c0a07edd2c5a (3.14.0-0.rc3.git2.2.fc21.x86_64)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.3-201.fc20.x86_64-advanced-c4778337-666c-45e1-8b20-ea175a8dd25c' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8  4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	else
	  search --no-floppy --fs-uuid --set=root 4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	fi
	linuxefi /vmlinuz-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks.uuid=luks-971c0950-cc9b-4dc3-b2f0-d7d681f743fb vconsole.keymap=us  vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet elevator=deadline selinux=0 LANG=en_US.utf8
	initrdefi /initramfs-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a.img
}
menuentry 'Fedora (3.14.0-0.rc3.git2.2.fc21.x86_64) 20 (Heisenbug)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.3-201.fc20.x86_64-advanced-c4778337-666c-45e1-8b20-ea175a8dd25c' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8  4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	else
	  search --no-floppy --fs-uuid --set=root 4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	fi
	linuxefi /vmlinuz-3.14.0-0.rc3.git2.2.fc21.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks.uuid=luks-971c0950-cc9b-4dc3-b2f0-d7d681f743fb vconsole.keymap=us  vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet elevator=deadline selinux=0 LANG=en_US.utf8
	initrdefi /initramfs-3.14.0-0.rc3.git2.2.fc21.x86_64.img
}
menuentry 'Fedora, with Linux 3.13.3-201.fc20.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.3-201.fc20.x86_64-advanced-c4778337-666c-45e1-8b20-ea175a8dd25c' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8  4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	else
	  search --no-floppy --fs-uuid --set=root 4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	fi
	linuxefi /vmlinuz-3.13.3-201.fc20.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks.uuid=luks-971c0950-cc9b-4dc3-b2f0-d7d681f743fb vconsole.keymap=us  vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet elevator=deadline selinux=0
	initrdefi /initramfs-3.13.3-201.fc20.x86_64.img
}
menuentry 'Fedora, with Linux 3.12.10-300.fc20.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.10-300.fc20.x86_64-advanced-c4778337-666c-45e1-8b20-ea175a8dd25c' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt8 --hint-efi=hd0,gpt8 --hint-baremetal=ahci0,gpt8  4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	else
	  search --no-floppy --fs-uuid --set=root 4720afb7-17e9-41c0-b91c-bae9a6bb9a78
	fi
	linuxefi /vmlinuz-3.12.10-300.fc20.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks.uuid=luks-971c0950-cc9b-4dc3-b2f0-d7d681f743fb vconsole.keymap=us  vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet elevator=deadline selinux=0
	initrdefi /initramfs-3.12.10-300.fc20.x86_64.img
}

### END /etc/grub.d/10_linux ###



And this is what I get if I call /etc/grub.d/10_linux directly. Note that the order is correct this time.

menuentry 'Fedora' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-' {
	load_video
	set gfxpayload=keep
	insmod gzio

	linuxefi /vmlinuz-3.14.0-0.rc3.git2.2.fc21.x86_64 root= ro  
	initrdefi /initramfs-3.14.0-0.rc3.git2.2.fc21.x86_64.img
}
submenu 'Advanced options for Fedora' $menuentry_id_option 'gnulinux-advanced-' {
	menuentry 'Fedora, with Linux 3.14.0-0.rc3.git2.2.fc21.x86_64' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-0.rc3.git2.2.fc21.x86_64-advanced-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.14.0-0.rc3.git2.2.fc21.x86_64 root= ro  
		initrdefi /initramfs-3.14.0-0.rc3.git2.2.fc21.x86_64.img
	}
	menuentry 'Fedora, with Linux 3.14.0-0.rc3.git2.2.fc21.x86_64 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.0-0.rc3.git2.2.fc21.x86_64-recovery-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.14.0-0.rc3.git2.2.fc21.x86_64 root= ro single 
		initrdefi /initramfs-3.14.0-0.rc3.git2.2.fc21.x86_64.img
	}
	menuentry 'Fedora, with Linux 3.13.3-201.fc20.x86_64' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.3-201.fc20.x86_64-advanced-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.13.3-201.fc20.x86_64 root= ro  
		initrdefi /initramfs-3.13.3-201.fc20.x86_64.img
	}
	menuentry 'Fedora, with Linux 3.13.3-201.fc20.x86_64 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.3-201.fc20.x86_64-recovery-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.13.3-201.fc20.x86_64 root= ro single 
		initrdefi /initramfs-3.13.3-201.fc20.x86_64.img
	}
	menuentry 'Fedora, with Linux 3.12.10-300.fc20.x86_64' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.10-300.fc20.x86_64-advanced-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.12.10-300.fc20.x86_64 root= ro  
		initrdefi /initramfs-3.12.10-300.fc20.x86_64.img
	}
	menuentry 'Fedora, with Linux 3.12.10-300.fc20.x86_64 (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.10-300.fc20.x86_64-recovery-' {
		load_video
		set gfxpayload=keep
		insmod gzio
	
		linuxefi /vmlinuz-3.12.10-300.fc20.x86_64 root= ro single 
		initrdefi /initramfs-3.12.10-300.fc20.x86_64.img
	}
	menuentry 'Fedora, with Linux 0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a-advanced-' {
		load_video
		insmod gzio
	
		linuxefi /vmlinuz-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a root= ro  
		initrdefi /initramfs-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a.img
	}
	menuentry 'Fedora, with Linux 0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a (recovery mode)' --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a-recovery-' {
		load_video
		insmod gzio
	
		linuxefi /vmlinuz-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a root= ro single 
		initrdefi /initramfs-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a.img
	}
}

Comment 6 Fedora End Of Life 2015-01-09 22:32:26 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Adam Williamson 2015-01-09 23:43:38 UTC
this got fixed, IIRC.


Note You need to log in before you can comment on or make changes to this bug.