Bug 741045

Summary: /etc/default/grub is a config file and should not be overwritten at update
Product: [Fedora] Fedora Reporter: Amir Hedayaty <hedayaty>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: awilliam, collura, dennis, fedora, horsley1953, mads, m.a.young, mishu, pjones, robatino, walterhurry
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: RejectedNTH
Fixed In Version: grub2-1.99-10.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-25 03:33:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to mark /etc/default/grub as %config(noreplace) none

Description Amir Hedayaty 2011-09-24 16:55:21 UTC
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 19:48:46 UTC
I assume a "not" is missing in the subject line?

Comment 2 Amir Hedayaty 2011-10-10 00:16:52 UTC
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 09:23:37 UTC
(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-14 01:35:27 UTC
*** Bug 744570 has been marked as a duplicate of this bug. ***

Comment 5 Adam Williamson 2011-10-14 01:35:33 UTC
*** Bug 745589 has been marked as a duplicate of this bug. ***

Comment 6 Michael Young 2011-10-14 10:54:55 UTC
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 19:47:30 UTC
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 22:03:46 UTC
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-20 02:22:33 UTC
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 18:21:20 UTC
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 04:23:21 UTC
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 07:11:59 UTC
(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 12:33:30 UTC
(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-25 03:33:12 UTC
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.