Bug 1153410 - grubby 8.35-6 results in unbootable system after (live) installation due to missing initrd16 line in grub.cfg
Summary: grubby 8.35-6 results in unbootable system after (live) installation due to m...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: grubby
Version: 21
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-16 02:41 UTC by Adam Williamson
Modified: 2015-04-27 23:59 UTC (History)
4 users (show)

Fixed In Version: grubby-8.35-7.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-20 23:02:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
journal output from a 'fail case' (new grubby, installed system missing initrd16 line) install (1.06 MB, text/plain)
2014-10-16 03:29 UTC, Adam Williamson
no flags Details
journal output from a 'success case' (old grubby, installed system not missing initrd16 line) install (1.06 MB, text/plain)
2014-10-16 03:30 UTC, Adam Williamson
no flags Details
grub.cfg from the success case (old grubby, working boot) (3.64 KB, text/plain)
2014-10-16 16:46 UTC, Adam Williamson
no flags Details
grub.cfg from the fail case (new grubby, no initrd16 line, no boot) (3.59 KB, text/plain)
2014-10-16 16:52 UTC, Adam Williamson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1215839 0 unspecified CLOSED grub2-mkconfig needs to use stanza titles that are like the titles we use elsewhere 2021-02-22 00:41:40 UTC

Internal Links: 1215839

Description Adam Williamson 2014-10-16 02:41:06 UTC
Splitting out the problems I'm seeing in testing the grubby for https://bugzilla.redhat.com/show_bug.cgi?id=1088933 , because I don't think they're necessarily related to that bug.

When I build a live image with grubby 8.35-6 and install from it, the installed system is not bootable with the 'real' kernel. The grub.cfg entry for that kernel has no 'initrd16' line. The rescue kernel has an initrd16 line.

For testing I built another live image which is identical but for having grubby 8.35-4 instead; installs from that live image boot successfully and have initrd16 lines.

http://paste.fedoraproject.org/142299/34247241/ is program.log from an affected install. These errors:

18:35:14,689 INFO program: /sbin/new-kernel-pkg: line 194: [: too many arguments
18:35:14,689 INFO program: /sbin/new-kernel-pkg: line 200: [: too many arguments

18:35:49,455 INFO program: /sbin/new-kernel-pkg: line 460: [: too many arguments
18:35:49,456 INFO program: /sbin/new-kernel-pkg: line 466: [: too many arguments

I identified the cause of and I don't think they're fatal. There is another error visible:

18:35:49,455 INFO program: cat: write error: Broken pipe

but that appears in the log from the successful install with the old grubby too, so I don't think that's it.

I've captured the journal from both success and failure cases and eyeballed compared it without seeing any significant differences other than the 'too many arguments' issue. Still investigating.

Comment 1 Adam Williamson 2014-10-16 03:29:03 UTC
Created attachment 947400 [details]
journal output from a 'fail case' (new grubby, installed system missing initrd16 line) install

Comment 2 Adam Williamson 2014-10-16 03:30:15 UTC
Created attachment 947401 [details]
journal output from a 'success case' (old grubby, installed system not missing initrd16 line) install

Comment 3 Peter Jones 2014-10-16 13:25:31 UTC
Can you actually attach the good and bad config files, as well?

Comment 4 Adam Williamson 2014-10-16 16:46:50 UTC
Created attachment 947678 [details]
grub.cfg from the success case (old grubby, working boot)

Comment 5 Adam Williamson 2014-10-16 16:52:35 UTC
Created attachment 947680 [details]
grub.cfg from the fail case (new grubby, no initrd16 line, no boot)

Comment 6 Adam Williamson 2014-10-16 16:53:25 UTC
aside from UUIDs, looks like it's really just the missing initrd16 line where they differ.

Comment 7 Adam Williamson 2014-10-16 17:22:10 UTC
So I think I have a theory, here - we may be hitting the new 'filter by title' stuff.

I ran the new-kernel-pkg command from the journal through sh -x, and it winds up running this:

+++ /sbin/grubby --grub2 -c /boot/grub2/grub.cfg --update-kernel=/boot/vmlinuz-3.17.0-301.fc21.x86_64 --initrd /boot/initramfs-3.17.0-301.fc21.x86_64.img '--args= LANG=en_CA.UTF-8' '--title=Fedora (3.17.0-301.fc21.x86_64) 21 (Twenty One)'

that title does not match anything in the grub.cfg - so I think that will mean the filter added to updateInitrd() in "[PATCH 6/9] Support filtering --update-kernel= by title as well." will not match?

Comment 8 Adam Williamson 2014-10-16 17:24:28 UTC
Yup, I think that's it. If I run the same command, but cut out the --title parameter, the initrd16 line shows up in the config file.

Comment 9 Adam Williamson 2014-10-16 17:28:43 UTC
new-kernel-pkg set_title() does this:

    elif [ -f /etc/os-release ]; then
	. /etc/os-release
	title="$NAME ($version) $VERSION"

if you look at /etc/os-release on an F21 box it has:

NAME=Fedora
VERSION="21 (Twenty One)"

so, that's where the title that gets used in the 'bad' new-kernel-pkg comes from. I don't know where the actual title in grub2.cfg - "Fedora, with Linux 3.17.0-301.fc21.x86_64" - comes from...kernel post?

Comment 10 Adam Williamson 2014-10-16 17:48:49 UTC
oh, no, it's from grub2-mkconfig. anaconda runs grub2-mkconfig at 22:19:22 then re-generates the initramfs and runs that grubby command (from c#7) and 22:19:30. So at some point, grub2-mkconfig's idea of what the kernel title should be and grubby's idea of what the kernel title should be have diverged.

grub2-mkconfig's title comes from /etc/grub.d/10_linux , it looks like:

...
title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
...
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-$version-$type-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
...

around line 98. If you trace it out, 'os' is taken from GRUB_DISTRIBUTOR in /etc/default/grub , 'version' is derived from the names of the actual kernels in /boot .

Comment 11 Fedora Update System 2014-10-16 18:42:28 UTC
grubby-8.35-7.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/FEDORA-2014-12932/grubby-8.35-7.fc21

Comment 12 Adam Williamson 2014-10-16 19:18:44 UTC
Looks good in a quick test, live image with -7 boots. Thanks.

Comment 13 Fedora Update System 2014-10-17 19:45:13 UTC
Package grubby-8.35-7.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grubby-8.35-7.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-12932/grubby-8.35-7.fc21
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2014-10-20 23:02:38 UTC
grubby-8.35-7.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


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