Bug 741045 - /etc/default/grub is a config file and should not be overwritten at update
/etc/default/grub is a config file and should not be overwritten at update
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
16
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
RejectedNTH
: Triaged
: 744570 745589 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-24 12:55 EDT by Amir Hedayaty
Modified: 2011-10-24 23:33 EDT (History)
11 users (show)

See Also:
Fixed In Version: grub2-1.99-10.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-10-24 23:33:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch to mark /etc/default/grub as %config(noreplace) (360 bytes, patch)
2011-10-19 15:47 EDT, Pavel Roskin
no flags Details | Diff

  None (edit)
Description Amir Hedayaty 2011-09-24 12:55:21 EDT
Description of problem:

/etc/default/grub is being overwritten with every grub
update (packaging bug I guess) as a result the default boot option is being
removed which is very annoying! 

Version-Release number of selected component (if applicable):


How reproducible:
grub2-1.99-6.fc16.x86_64

Steps to Reproduce:
1.edit /etc/default/grub
2.hae a update including grub

  
Actual results:
the file is overwritten

Expected results:
the original file
Comment 1 Mads Kiilerich 2011-09-25 15:48:46 EDT
I assume a "not" is missing in the subject line?
Comment 2 Amir Hedayaty 2011-10-09 20:16:52 EDT
I realized it actually being overwritten by kernel update?!!!
Why should kernel touch anything related to grub? should not grub 
have a trigger to update itself when a new kernel is installed?
Comment 3 Mads Kiilerich 2011-10-10 05:23:37 EDT
(In reply to comment #2)
> I realized it actually being overwritten by kernel update?!!!

There is no way this could happen. (Famous last words...) Can you elaborate?

> Why should kernel touch anything related to grub? should not grub 
> have a trigger to update itself when a new kernel is installed?

The kernel packages will invoke grubby in the post scripts, and grubby will patch grub.cfg directly.
Comment 4 Adam Williamson 2011-10-13 21:35:27 EDT
*** Bug 744570 has been marked as a duplicate of this bug. ***
Comment 5 Adam Williamson 2011-10-13 21:35:33 EDT
*** Bug 745589 has been marked as a duplicate of this bug. ***
Comment 6 Michael Young 2011-10-14 06:54:55 EDT
I am seeing this. The problem is the /etc/default/grub is not packaged in grub2 as a configuration file, so it is overwritten each time you update grub2 and you lose any local customization. grubby may not read it, but some people will be using grub2-mkconfig so you shouldn't keep overwriting this file.
Comment 7 Pavel Roskin 2011-10-19 15:47:30 EDT
Created attachment 529090 [details]
patch to mark /etc/default/grub as %config(noreplace)

I used GRUB2 from Fedora 15.  After upgrading to Fedora 16, the GRUB2 configuration was lost.  The serial console settings were gone, as well as irqpoll and other goodies.  I don't even remember what else I had in that file.  Even replacing with a backup may be annoying, but replacing with no backup is just pure evil!
Comment 8 Fedora Update System 2011-10-19 18:03:46 EDT
grub2-1.99-10.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub2-1.99-10.fc16
Comment 9 Fedora Update System 2011-10-19 22:22:33 EDT
Package grub2-1.99-10.fc16:
* 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-10.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14602
then log in and leave karma (feedback).
Comment 10 Adam Williamson 2011-10-21 14:21:20 EDT
Discussed at 2011-10-21 NTH review meeting. Agreed this doesn't need to be taken through a freeze, it could be fixed post-release with an update equally well. RejectedNTH.

Note we're not frozen yet; if the update gets one more +1 it will go into the release anyway.
Comment 11 Amir Hedayaty 2011-10-24 00:23:21 EDT
Thanks, I believe the bug can be closed but the small discussion remains,

Do we still need grubby with grub2? dependency of kernel on grub does nor seem all-right to me, I agree I do not have the experience you guys have, and removing a nicely written package like grubby may not be very easy on grubby developers.

What I am suggesting is using potentials in the design of rpm. Put a trigger on 
grub2, when kernel is updated run grub2-mkconfig.
Comment 12 Andy Burns 2011-10-24 03:11:59 EDT
(In reply to comment #11)

> What I am suggesting is using potentials in the design of rpm. Put a trigger on 
> grub2, when kernel is updated run grub2-mkconfig.

That concept works when Xen packages are updated, grub.cnf is regenerated rather than tweaked by grubby.
Comment 13 Mads Kiilerich 2011-10-24 08:33:30 EDT
(In reply to comment #11)
> Do we still need grubby with grub2? dependency of kernel on grub does nor seem
> all-right to me,

There is no dependency from kernel to grub. The kernel depends on grubby, and grubby will update the boot loader config files it finds.

I wouldn't call grubby nice. It is impressive - it works and is very compact and efficient, but it is a bit of a hack. Parsing and patching different config file formats in C is inherently error prone.

The grub config system is however worse. It is vastly over-engineered and it adds more complexity than it hides. The grub documentation kind of acknowledges that in http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration: those who feel that it would be easier to write grub.cfg directly are encouraged to do so.
Comment 14 Fedora Update System 2011-10-24 23:33:12 EDT
grub2-1.99-10.fc16 has been pushed to the Fedora 16 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.