Hello,
After an update of teh kernel. the file: /boot/grub2/grub.cfg is updated. However thsi file is not update properly. If I run: grub2-mkconfig -o /boot/grub2/grub.cfg then the file is OK.
Somebody can tell me what is going on?
Thank.
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com Laboratoire de Physico-Chimie de l'Atmosphère | | Université du Littoral-Côte d'Opale | | Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44 189A, avenue Maurice Schumann | | 59140 Dunkerque, France ===========================================================================
On Sun, 18 May 2014 14:57:14 +0200, Patrick Dupre wrote:
Hello,
After an update of teh kernel. the file: /boot/grub2/grub.cfg is updated. However thsi file is not update properly.
How? In which way is it not updated "properly"?
Prior to installing a new kernel, you could save a copy of grub.cfg, install a new kernel package, and then run diff on the old and new grub.cfg. What do you get?
If I run: grub2-mkconfig -o /boot/grub2/grub.cfg then the file is OK.
Define "OK".
grub2-mkconfig rewrites grub.cfg from scratch and under consideration of template files, such as those in /etc/grub.d, and add-on tools such as os-prober.
On the contrary, grubby (as run via the kernel packages) only inserts a new boot entry into the existing file. It does not recreate the file completely.
Somebody can tell me what is going on?
You haven't given enough details.
On 05/18/2014 11:57 PM, Michael Schwendt wrote:
On Sun, 18 May 2014 14:57:14 +0200, Patrick Dupre wrote:
Hello,
After an update of teh kernel. the file: /boot/grub2/grub.cfg is updated. However thsi file is not update properly.
How? In which way is it not updated "properly"?
Prior to installing a new kernel, you could save a copy of grub.cfg, install a new kernel package, and then run diff on the old and new grub.cfg. What do you get?
If I run: grub2-mkconfig -o /boot/grub2/grub.cfg then the file is OK.
Define "OK".
grub2-mkconfig rewrites grub.cfg from scratch and under consideration of template files, such as those in /etc/grub.d, and add-on tools such as os-prober.
On the contrary, grubby (as run via the kernel packages) only inserts a new boot entry into the existing file. It does not recreate the file completely.
Hi Michael, My experience with grubby being run after kernel installs, when I have been able to get it to run, is that it does recreate the entire grub.cfg file. For example, I have been in the situation where the boot menu had an entry for the latest kernel followed by an group entry for 'Advanced Fedora Options' (or something similar) along with the same structure for Ubuntu, then after running grubby, the groupings were removed and all the entries that were listed in the groups were moved to the top level.
regards, Steve
Somebody can tell me what is going on?
You haven't given enough details.
On Mon, 19 May 2014 08:08:54 +1000, Stephen Morris wrote:
My experience with grubby being run after kernel installs, when I
have been able to get it to run, is that it does recreate the entire grub.cfg file. For example, I have been in the situation where the boot menu had an entry for the latest kernel followed by an group entry for 'Advanced Fedora Options' (or something similar) along with the same structure for Ubuntu, then after running grubby, the groupings were removed and all the entries that were listed in the groups were moved to the top level.
Can't confirm.
These are the steps I've tested with on Fedora 20:
1) In /etc/default/grub I've set
GRUB_DISABLE_SUBMENU=false
2) I've run "grub2-mkconfig -o /boot/grub2/grub.cfg" to create the grub.cfg with submenus.
3) I've saved grub.cfg as ~/grub.cfg.MKCONFIG
4) I've run "yum --enablerepo=rawhide install kernel" to add the kernel package from Rawhide.
5) I've run "diff -u ~/grub.cfg.MKCONFIG /boot/grub2/grub.cfg" to display the differences.
What has changed in grub.cfg?
* a new "menuentry" block for the new kernel at the top * removed trailing whitespace at the end of "linux" lines * replaced double-quote characters with single-quotes in menuentry blocks
Upon "yum history undo …" only the added menuentry block was removed again.
On 05/19/2014 08:42 AM, Michael Schwendt wrote:
On Mon, 19 May 2014 08:08:54 +1000, Stephen Morris wrote:
My experience with grubby being run after kernel installs, when I
have been able to get it to run, is that it does recreate the entire grub.cfg file. For example, I have been in the situation where the boot menu had an entry for the latest kernel followed by an group entry for 'Advanced Fedora Options' (or something similar) along with the same structure for Ubuntu, then after running grubby, the groupings were removed and all the entries that were listed in the groups were moved to the top level.
Can't confirm.
These are the steps I've tested with on Fedora 20:
In /etc/default/grub I've set
GRUB_DISABLE_SUBMENU=false
I've run "grub2-mkconfig -o /boot/grub2/grub.cfg" to create the grub.cfg with submenus.
I've saved grub.cfg as ~/grub.cfg.MKCONFIG
I've run "yum --enablerepo=rawhide install kernel" to add the kernel package from Rawhide.
I've run "diff -u ~/grub.cfg.MKCONFIG /boot/grub2/grub.cfg" to display the differences.
What has changed in grub.cfg?
- a new "menuentry" block for the new kernel at the top
- removed trailing whitespace at the end of "linux" lines
- replaced double-quote characters with single-quotes in menuentry blocks
Upon "yum history undo …" only the added menuentry block was removed again.
Looks like grubby has changed since the last time I used it, it is now creating sub-entries as well. I'll need to now check if I still get the same problem on kernel updates where grubby fails with an authorization failure even though the update process is run under sudo, but when I run grubby manually under sudo it runs fine.
regards, Steve
On May 18, 2014, at 4:08 PM, Stephen Morris samorris@netspace.net.au wrote:
On 05/18/2014 11:57 PM, Michael Schwendt wrote:
On Sun, 18 May 2014 14:57:14 +0200, Patrick Dupre wrote:
Hello,
After an update of teh kernel. the file: /boot/grub2/grub.cfg is updated. However thsi file is not update properly.
How? In which way is it not updated "properly"?
Prior to installing a new kernel, you could save a copy of grub.cfg, install a new kernel package, and then run diff on the old and new grub.cfg. What do you get?
If I run: grub2-mkconfig -o /boot/grub2/grub.cfg then the file is OK.
Define "OK".
grub2-mkconfig rewrites grub.cfg from scratch and under consideration of template files, such as those in /etc/grub.d, and add-on tools such as os-prober.
On the contrary, grubby (as run via the kernel packages) only inserts a new boot entry into the existing file. It does not recreate the file completely.
Hi Michael, My experience with grubby being run after kernel installs, when I have been able to get it to run, is that it does recreate the entire grub.cfg file. For example, I have been in the situation where the boot menu had an entry for the latest kernel followed by an group entry for 'Advanced Fedora Options' (or something similar) along with the same structure for Ubuntu, then after running grubby, the groupings were removed and all the entries that were listed in the groups were moved to the top level.
It definitely doesn't recreate the entire file. It does have the ability to add and remove certain entries, and I've experienced the same thing you've described, but it's not easy to reproduce the conditions.
The solution employed on Fedora a while ago was disabling grub submenus by default. I think it's an amusing workaround because ostensibly the idea of grubby is to avoid throwing away data in the grub.cfg that represents the current bootable states of a system, and yet here's an example where it does exactly that.
Chris Murphy