Bug 1099 - [blacksand/emenlow/crownbay] grub install failed with sato-sdk live image
Summary: [blacksand/emenlow/crownbay] grub install failed with sato-sdk live image
Status: VERIFIED FIXED
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-configuration (show other bugs)
Version: unspecified
Hardware: E-Menlow Multiple
: High major
Target Milestone: 1.1 M2
Assignee: Dexuan Cui
QA Contact:
URL:
Whiteboard: Patch already in poky master(29/Jun/2...
Depends on:
Blocks:
 
Reported: 2011-05-25 07:57 UTC by Jiajun Xu
Modified: 2011-07-12 23:26 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiajun Xu 2011-05-25 07:57:42 UTC
Tree/Branch: Poky/1.1_M1
Poky Commit: fc55b224caa3eeac4abda099ec9ed505db59fb28
Meta Branch: 1.1_M1
Meta Commit: 1b227f8ed2df529cc13f7169b0c08ff3d0f8c812
Image Location:
emenlow: http://autobuilder02.pokylinux.org/emenlow/nightly/20110521-1/machines/emenlow/x86_32/core-image-sato-sdk-live-emenlow-20110521070906.hddimg.bz2
crownbay: http://autobuilder02.pokylinux.org/crownbay-noemgd/nightly/20110520-1/machines/crownbay/x86_32/core-image-sato-sdk-live-crownbay-noemgd-20110521035553.hddimg.bz2

With Yocto 1.1 M1 RC1 build, some BSP images could not install successfully on target platform. Installer fails when grub install.

The error message is as below:
##########
                           ......
                           Ext3-fs: barriers noet enableed
                           ......
                           grub> checking if "boot/grub/stage 1" exists ....yes
                           grub> checking if "boot/grub/stage 2" exists ....yes
                           grub> checking if "boot/grub/stage e2fs_stage1_5" exists ....yes
                           Running "ember /boot/grub/e2fs_stage1_5(hd0,0)" .... failed (this is not fatal)
                           Running "ember /boot/grub/e2fs_stage1_5(hd0,0)" .... failed (this is not fatal)
                           Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0) /boot/grub/stage2 p /boot/grub/menu list" failed
                           .............
                           Error 6: Mismatched or corrupt version of stage1/stage2
##########
Comment 1 Jiajun Xu 2011-05-26 07:24:08 UTC
blacksand also has such issue.
Comment 2 Darren Hart 2011-05-26 13:37:54 UTC
This appears at first glance to be a buggy grub build. Perhaps gcc 4.6 + tune-atom.inc ?
Comment 3 Darren Hart 2011-05-26 15:23:27 UTC
Tom, if you're the owner of grub can you accept?
Comment 4 Tom Zanussi 2011-05-26 15:31:05 UTC
(In reply to comment #3)
> Tom, if you're the owner of grub can you accept?

I'm not the owner of grub.
Comment 5 Bruce Ashfield 2011-06-06 11:16:18 UTC
Any idea what the fs-type is for the partition where grub is installing ?
Comment 6 Edwin Zhai 2011-06-19 19:51:56 UTC
Dexuan is kind to help on this bug.
Comment 7 Dexuan Cui 2011-06-29 01:50:54 UTC
I got the root cause:
this is due to a known gcc-4.6-related optimization bug. will send out patch soon:

--- grub-0.97/stage2/Makefile.am.orig
+++ grub-0.97/stage2/Makefile.am
@@ -79,7 +79,7 @@
 HERCULES_FLAGS =
 endif

-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
    $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)

 STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
Comment 8 Dexuan Cui 2011-06-29 06:20:44 UTC
(In reply to comment #7)
> I got the root cause:
> this is due to a known gcc-4.6-related optimization bug. will send out patch
> soon:
> --- grub-0.97/stage2/Makefile.am.orig
> +++ grub-0.97/stage2/Makefile.am
> @@ -79,7 +79,7 @@
>  HERCULES_FLAGS =
>  endif
> -STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
> +STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin
> -nostdinc \
>     $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
>  STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000

After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
we got this bug.

This turned out to be a gcc's bug. See
https://bugs.gentoo.org/show_bug.cgi?id=360513
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333

Upstream gcc seems uninterested in the bug, so at present we can disable the
option as a workaround. Thanks Ryan Hill for the investigation and the
workaround patch.