Red Hat Bugzilla – Bug 806172
grub2-reboot/set-default doesn't work
Last modified: 2015-02-08 16:42:48 EST
+++ This bug was initially created as a clone of Bug #732058 +++
Description of problem:
With default setup, two kernel images, 'grub2-reboot 1' updates grubenv, but this settings is not honoured, kernel 0 is booted instead.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. setup 2 kernels
2. grub2-reboot 1
kernel 0 is booted
kernel 1 is booted once
Same with grub2-set-default
--- Additional comment from firstname.lastname@example.org on 2011-08-22 17:26:20 CST ---
My fault, it needs a bit grub2 config tweaking:
$ cat /etc/default/grub
Then it works OK. Could we go with it by default in Fedora? I need this functionality in pm-utils 01grub hook. I can also only document this requirement. Or is there any other possibility how to emulate the --once in grub2 with default config?
--- Additional comment from email@example.com on 2011-09-17 03:08:07 CST ---
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
--- Additional comment from firstname.lastname@example.org on 2011-10-25 04:31:10 CST ---
Note that anaconda by default will overwrite /etc/default/grub with GRUB_DEFAULT=saved but no GRUB_SAVEDEFAULT.
grubby will however be invoked with --make-default and replace
I guess the best way to get "boot once" would be to create some /etc/grub.d/01_pm that set the default based on the boot environment variables in another way.
grub2-set-default is apparently a bad fit for Fedora where that usually is handled by grubby.
--- Additional comment from email@example.com on 2011-10-26 03:23:23 CST ---
I just noticed that anaconda runs grub2-set-default.
--- Additional comment from firstname.lastname@example.org on 2011-11-18 16:31:02 CST ---
*** Bug 753633 has been marked as a duplicate of this bug. ***
--- Additional comment from email@example.com on 2011-11-18 16:41:19 CST ---
(In reply to comment #3)
> I guess the best way to get "boot once" would be to create some
> /etc/grub.d/01_pm that set the default based on the boot environment variables
> in another way.
I can reinvent the wheel and implement own /etc/grub.d/01_pm, but I think the boot once functionality should be there out of the box as was in previous fedoras. Other packages could also benefit from it, not only the pm-utils.
--- Additional comment from firstname.lastname@example.org on 2011-11-27 21:14:30 CST ---
What I just discovered after doing a fresh install of F16 is that it keeps booting the kernel which came with the installation, even after it installed a new kernel through the updates. Is my problem related to this bug or should I file a new bug?
I also don't understand why GRUB_DEFAULT is set to 'saved' (which I assume has something to do with this problem)? On my Kubuntu machine it is set to '0' so that the latest kernel is always booted, why does Fedora do it differently?
--- Additional comment from email@example.com on 2011-11-28 00:38:42 CST ---
Alexander, please file a new bug for the grubby component and attach your grub.cfg.
--- Additional comment from firstname.lastname@example.org on 2011-11-28 21:37:51 CST ---
Done, bug #757712.
--- Additional comment from email@example.com on 2011-11-29 01:01:14 CST ---
*** Bug 757712 has been marked as a duplicate of this bug. ***
--- Additional comment from firstname.lastname@example.org on 2011-12-09 18:58:25 CST ---
*** Bug 761055 has been marked as a duplicate of this bug. ***
--- Additional comment from Jmlevick@gmail.com on 2011-12-10 05:09:24 CST ---
I have a workaround for this...
You have to add these two lines to your "/etc/default/grub" file:
(Maybe you already have "GRUB_DEFAULT" but with "saved" value, change it to 0, the other line I'll bet you don't have it by default in that file...) We can also change "GRUB_TIMEOUT" to 0 if we don't want to see the kernels list when booting.
Then, we have to run:
grub2-mkconfig -o /boot/grub2/grub.cfg
And that's it, You'll be always booting into the last kernel without any problems.
That fixed the bug for me, in my case, I noticed same thing than Alexander van Loon.
--- Additional comment from email@example.com on 2011-12-10 10:44:23 CST ---
*** Bug 758627 has been marked as a duplicate of this bug. ***
--- Additional comment from firstname.lastname@example.org on 2011-12-10 10:53:57 CST ---
I'd like to support Jaroslav's request, that
$ cat /etc/default/grub
become the default. The problem with the current configuration is that grub2
works in an easy-to-understand way out-of-the-box, but making any change - just
changing kernel parameters, for example - requires running grub2-mkconfig,
which then changes the behaviour in completely unexpected ways (just look at
the number of bugs marked as duplicates of this one). Changing a kernel
parameter should not require a detailed understanding of grub2 and how it
differs from grub.
--- Additional comment from email@example.com on 2011-12-10 14:09:20 CST ---
grub2-1.99-13.fc16 has been submitted as an update for Fedora 16.
--- Additional comment from firstname.lastname@example.org on 2011-12-10 23:34:58 CST ---
(In reply to comment #12)
> I have a workaround for this...
It is only a partial workaround. It will only work until the first time a new kernel is installed, as mentioned in comment 3. I don't know if that is by design or not.
A solution could be if new-kernel-pkg used grubby --default-kernel to see if it should use grubby --make-default or grub2-set-default. (That might require a fix for bug 736188 first.)
--- Additional comment from email@example.com on 2011-12-12 05:53:49 CST ---
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub2-1.99-13.fc16'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
--- Additional comment from Jmlevick@gmail.com on 2011-12-14 08:12:46 CST ---
@Mads Kiilerich: the workaround I posted is actually permanent I tested it in two different computers updating their kernels after applying the workaround... Anyway the update pushing is better ;)
--- Additional comment from firstname.lastname@example.org on 2011-12-31 06:56:05 CST ---
grub2-1.99-13.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.