Bug 782144 - Regression in core.img size in grub2-1.99-13.fc16
Regression in core.img size in grub2-1.99-13.fc16
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
16
i686 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
: Regression
: 771524 784885 785376 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-16 11:20 EST by David Benjamin
Modified: 2012-04-24 14:38 EDT (History)
18 users (show)

See Also:
Fixed In Version: grub2-1.99-13.fc16.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-20 22:30:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Benjamin 2012-01-16 11:20:44 EST
Description of problem: Filing a new bug per comment 45 of bug 737508. grub2-1.99-13 regressed in the size of core.img from grub2-1.99-12 so that it no longer fits in under 32K.

I hit this on (pre)upgrade from F15 which left my machine unbootable. Managed to get in and downgrade to -12 which fixed it for now. My disk shouldn't be terribly strange. Single disk installed with the defaults of some Fedora release way back (F11 it seems?). There is a "Dell Utility" partition starting at sector 63, so I can't fit something larger without messing with it.

Version-Release number of selected component (if applicable): 1.99-13.fc16

How reproducible: Always
Comment 1 Ian Collier 2012-01-30 08:59:57 EST
This is because the build is no longer optimized for space.

* Rel 13 builds with RPM_OPT_FLAGS whereas rel 12 did not (bug 704820).
* RPM_OPT_FLAGS contains -O2 which overrides the -Os provided by grub's configure script.
Comment 2 Mikkel Lauritsen 2012-02-14 07:08:41 EST
Same problem here. Just preupgraded default F14 installation on a laptop (no raid or anything fancy) and anaconda told me that it was unable to install the boot loader.

Fixed it the same way as mentioned above: booted from a network install CD, downloaded grub2-1.99-12 and installed it using rpm -U --oldpackage . After this I was able to run grub2-install /dev/sda without problems.
Comment 3 Orion Poplawski 2012-02-17 11:57:36 EST
*** Bug 784885 has been marked as a duplicate of this bug. ***
Comment 4 Fedora Update System 2012-02-17 12:15:03 EST
grub2-1.99-13.fc16.1 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub2-1.99-13.fc16.1
Comment 5 Fedora Update System 2012-02-17 18:50:58 EST
Package grub2-1.99-13.fc16.1:
* 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.1'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-1925/grub2-1.99-13.fc16.1
then log in and leave karma (feedback).
Comment 6 Cesar Eduardo Barros 2012-02-18 13:31:23 EST
grub2-1.99-13.fc16.1 did not work for me.

After seeing the error, but before rebooting, I did a chroot into the installed system and upgraded to grub2-1.99-13.fc16.1 (from the updates-testing repository). The core.img was still too big. Then I downgraded to grub2-1.99-12.fc16 (from the fedora repository), and it worked.

This particular installation does not even have LVM, so the image should have been even smaller.

Sorry for not getting more information (copies of the generated core.img files, the exact file sizes, and so on), but I was too focused into making it install, so I could reboot and continue the installation.
Comment 7 Jacek Piskozub 2012-02-18 14:39:01 EST
I second Cesar here. I had increased the unallocated disk space in front of /dev/sda1 so both grub2-1.99-13.fc16 and grub2-1.99-13.fc16.1 work for me. But I still can create core.img with any grub2 version I like. I used "grub2-install /dev/sda" in each case.

A short Google search told me core.img should fit 61 sectors (31232 bytes)

This are the sizes I produced:
  
grub2-1.99-12.fc16    29230 bytes
grub2-1.99-13.fc16    31743 bytes
grub2-1.99-13.fc16.1  31743 bytes     

It seems the optimization patch did not work (a pity it was not attached to the bug).
Comment 8 Ian Collier 2012-02-18 15:16:30 EST
The spec file builds grub twice - it looks like the efi build has been fixed but the plain build has not.
Comment 9 Jacek Piskozub 2012-02-18 16:13:06 EST
Another thing. I have compared the grub2.spec files from 12 and 13.1 versions.

The latest (13.1) file has a line 112 in definition of CFLAGS that version 12 does not have.

-e 's/-O.//g'					\


Isn't this the smoking gun?
Comment 10 Jacek Piskozub 2012-02-18 16:37:17 EST
Ian, so removing the optimization flags for efi is the right thing to do and should be repeated below line 144? Do I read you correctly?
Comment 11 Ian Collier 2012-02-18 17:35:33 EST
#10 - that's right, yes.
Comment 12 Cesar Eduardo Barros 2012-02-18 17:52:33 EST
Comparing the size of the /usr/lib/grub2/i386-pc directory between 1.99-13.fc16 and 1.99-13.fc16.1, they are identical. Comparing the size of that directory between 1.99-12.fc16 and 1.99-13.fc16.1, there are several differences in the file sizes:

-36	./bsd.mod
+40	./bsd.mod
-8	./fat.mod
+12	./fat.mod
-16	./font.mod
+20	./font.mod
-4	./fshelp.mod
+8	./fshelp.mod
-8	./functional_test.mod
+4	./functional_test.mod
-20	./gcry_rijndael.mod
+24	./gcry_rijndael.mod
-16	./gfxterm.mod
+20	./gfxterm.mod
-4	./hexdump.mod
+8	./hexdump.mod
-44	./kernel.img
+48	./kernel.img
-16	./multiboot2.mod
+20	./multiboot2.mod
-120	./normal.mod
+128	./normal.mod
-56	./regexp.mod
+64	./regexp.mod
-4	./search_fs_uuid.mod
+8	./search_fs_uuid.mod
-16	./terminfo.mod
+20	./terminfo.mod
-12	./uhci.mod
+8	./uhci.mod
-8	./usbserial_pl2303.mod
+4	./usbserial_pl2303.mod
-28	./video_fb.mod
+32	./video_fb.mod
-8	./videoinfo.mod
+4	./videoinfo.mod
-12	./video.mod
+8	./video.mod
-12	./xfs.mod
+8	./xfs.mod
-12	./zfsinfo.mod
+8	./zfsinfo.mod

Also, I just noticed that I said a nonsense thing above: of course LVM makes no difference, the LVM code is on the initrd, not on grub2.

The file sizes I saw are similar to what Jacek Piskozub is seeing; the core.img currently in use here for the machine in question is 29237 bytes.
Comment 13 Adam Williamson 2012-02-21 22:32:26 EST
I think Ian Collier has it correct, thanks for the catch. I'm in the process of doing a -14 build for rawhide, 17 and 16 with this fix.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 14 Adam Williamson 2012-02-21 22:59:25 EST
Unfortunately, grub2 fails to build on f17/f18 at present due to changes in autotools. The upstream patch to fix it - http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/3766 - doesn't apply cleanly to our grub2, due to intermediate changes in the files which we haven't backported.

I don't want to poke this too hard without peter's input - peter, do you want to take the pain to manually fix the patch so it applies, or should we just consider bumping to an upstream snapshot at some point? or something else?
Comment 15 Tomáš Trnka 2012-03-11 07:06:40 EDT
(In reply to comment #10)
> Ian, so removing the optimization flags for efi is the right thing to do and
> should be repeated below line 144? Do I read you correctly?

Confirming this. I've added -e 's/-O.//g' to the non-efi part of the 13.fc16.1 spec and this has brought the sizes of the four modules my machine is using (bootdisk, ext2, fshelp and part_msdos) back exactly to the 12.fc16 values.

So at least on x86_64 non-EFI the bug can be fixed this way. Could anyone please push an update for F16?
Comment 16 Adam Williamson 2012-03-11 20:48:35 EDT
I was going to, but since F17/Rawhide couldn't be fixed at the same time I figured I'd wait for Peter. I think he said on IRC he should have an F17/Rawhide build soon.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 17 Fedora Update System 2012-03-12 15:09:33 EDT
grub2-1.99-13.fc16.2 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub2-1.99-13.fc16.2
Comment 18 Jacek Piskozub 2012-03-14 13:48:59 EDT
Testing the newest version downloaded straight from koji:

This are the sizes of core.img I produced:

grub2-1.99-12.fc16    29230 bytes
grub2-1.99-13.fc16    31743 bytes
grub2-1.99-13.fc16.1  31743 bytes 
grub2-1.99-13.fc16.2  29298 bytes   

which means on my box the latest version made this file slightly larger than 1.99-12 but well under the upper limit of 31232 bytes.

In short: the patch worked.
Comment 19 Fedora Update System 2012-03-14 22:19:29 EDT
Package grub2-1.99-13.fc16.2:
* 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.2'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-3697/grub2-1.99-13.fc16.2
then log in and leave karma (feedback).
Comment 20 Milan Kerslager 2012-03-20 06:01:03 EDT
grub2-1.99-13.fc16.2 fixes the problem. Please push into stable, as network installation is impossible now because update repo contain broken version. Leave karma if possible, please, as noted above.
Comment 21 Fedora Update System 2012-03-20 22:30:25 EDT
grub2-1.99-13.fc16.2 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 22 Mads Kiilerich 2012-04-16 19:31:19 EDT
*** Bug 785376 has been marked as a duplicate of this bug. ***
Comment 23 Mads Kiilerich 2012-04-24 14:38:49 EDT
*** Bug 771524 has been marked as a duplicate of this bug. ***

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