Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot Compile grub2
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 8:17 am    Post subject: Cannot Compile grub2 Reply with quote

Hello,

I'm creating a new setup on amd64 with both mdraid and lvm. As I understood, to be able to boot on raid with version 1.2 metadata, i need grub 2, is this right?

I'm trying to emerge grub:2 but it does not compile and ends with the following error:
Code:

 * ERROR: sys-boot/grub-9999 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of 'emerge --info =sys-boot/grub-9999',
 * the complete build log and the output of 'emerge -pqv =sys-boot/grub-9999'.
 * The complete build log is located at '/var/tmp/portage/sys-boot/grub-9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-9999/temp/environment'.
 * S: '/var/tmp/portage/sys-boot/grub-9999/work/grub-9999'


here is some info:


Does anyone as an idea how can fix this? Or can I boot my system without grub2?
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1173
Location: Austria

PostPosted: Mon Jan 16, 2012 8:24 am    Post subject: Reply with quote

Mind posting the actual error above the "ERROR: sys-boot/grub-9999 failed (compile phase):" message?

btw - this is a live-ebuild which checks out stuff from a bzr repo which we do not control. In other words, if they broke stuff, we cannot do much against that.

another hint: USE=custom-cflags is known to break stuff.

Update:
Looks like that automagic stuff is broken:

Quote:
***** automake *****
***** PWD: /var/tmp/portage/sys-boot/grub-9999/work/grub-9999
***** automake --add-missing --copy

configure.ac:272: installing `build-aux/compile'
configure.ac:43: installing `build-aux/config.guess'
configure.ac:43: installing `build-aux/config.sub'
configure.ac:46: installing `build-aux/install-sh'
configure.ac:46: installing `build-aux/missing'
docs/Makefile.am:4: installing `build-aux/mdate-sh'
docs/Makefile.am:4: installing `build-aux/texinfo.tex'
conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
grub-core/Makefile.am:5: `conf/Makefile.common' included from here
grub-core/Makefile.am: installing `build-aux/depcomp'
conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
grub-core/Makefile.am:5: `conf/Makefile.common' included from here
conf/Makefile.common:150: `pkglibdir' is not a legitimate directory for `SCRIPTS'
Makefile.am:6: `conf/Makefile.common' included from here
conf/Makefile.common:140: `pkglibdir' is not a legitimate directory for `DATA'
Makefile.am:6: `conf/Makefile.common' included from here

_________________
Please stand by - The mailer daemon is busy burning your messages in hell...


Last edited by ToeiRei on Mon Jan 16, 2012 8:40 am; edited 1 time in total
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 8:37 am    Post subject: Reply with quote

I tried already to remove the use flag custom-cflags but I get the same results / error.

Sorry, that's the error:
Code:

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/grub-core -I..  -Wall -W -I/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/include -I../include  -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -m32 -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include -DGRUB_FILE=\"boot/i386/pc/startup_raw.S\" -I. -I/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/grub-core -I.. -I/var/tmp/portage/sys-boot/grub-9999/work/grub-9999 -I/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/include -I../include     -g -m32 -DASM_FILE=1    -march=native -O2 -pipe -fomit-frame-pointer -mtune=amdfam10 -funroll-all-loops -ffast-math -mcx16 -mpopcnt -mabm -msahf -m3dnow -mmmx -msse -msse2 -msse3 -msse4a -c -o boot/i386/pc/lzma_decompress_image-startup_raw.o `test -f 'boot/i386/pc/startup_raw.S' || echo '/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/grub-core/'`boot/i386/pc/startup_raw.S
reed_solomon.c: Assembler messages:
reed_solomon.c:651: Warning: ignoring changed section attributes for .text
/var/tmp/portage/sys-boot/grub-9999/work/grub-9999/grub-core/boot/i386/pc/startup_raw.S:119: Error: attempt to move .org backwards
make[3]: *** [boot/i386/pc/lzma_decompress_image-startup_raw.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/sys-boot/grub-9999/work/build-pc/grub-core'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-boot/grub-9999/work/build-pc/grub-core'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-boot/grub-9999/work/build-pc'
make: *** [all] Error 2
 * ERROR: sys-boot/grub-9999 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of 'emerge --info =sys-boot/grub-9999',
 * the complete build log and the output of 'emerge -pqv =sys-boot/grub-9999'.
 * The complete build log is located at '/var/tmp/portage/sys-boot/grub-9999/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-9999/temp/environment'.
 * S: '/var/tmp/portage/sys-boot/grub-9999/work/grub-9999'



I their a way to install a stabilized version instead of the current bzr of grub 2? I don't mind about which bootloader I have, I just want to boot my system :wink:
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1173
Location: Austria

PostPosted: Mon Jan 16, 2012 8:45 am    Post subject: Reply with quote

You could try increasing #define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART 0x6e0 to 0x7f0 in include/grub/offsets.h (keep it divisible by 8 and don't increase too much) if you don't mind any hacking...

have a look at the ebuild commands so you can mess around with the sources in the workdir (/var/tmp/portage/...)
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1173
Location: Austria

PostPosted: Mon Jan 16, 2012 8:58 am    Post subject: Reply with quote

Small update:

I could get round my automake problem by downgrading automake to 1.11.1. New 1.11.2 seems to have an issue due to an upstream change making pkglib_{DATA,SCRIPTS} invalid. It needs to be pkgdata_{DATA_SCRIPTS} due to which grub2 modules are not longer installed...

But I cannot reproduce your issue here on my ~amd64
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 9:15 am    Post subject: Reply with quote

Currently I've 0x7e0 as value for GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART. I've tried to change it to 0x7f0 but at each emerge the file is reverted back to 0x7e0. How can I make the change living for the next emerge?

I'm not running ~amd64, I just unmasked grub2. Should I use grub-1.99-r2.ebuild insteand of 9999 version?
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1173
Location: Austria

PostPosted: Mon Jan 16, 2012 9:23 am    Post subject: Reply with quote

ToeiRei wrote:
have a look at the ebuild commands so you can mess around with the sources in the workdir (/var/tmp/portage/...)


ebuild /path/to/ebuild [action]

[action] may be help, setup, clean, fetch...

you might want to do 'prepare', modify the sources and finally do 'merge'
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 9:34 am    Post subject: Reply with quote

still the same issue with 0x7f0 as value for GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART


at the beginning of the prepare I see those warnings, are them ok?


Code:
>>> Unpacking source...
 * bzr pull start -->
 *    repository: http://bzr.savannah.gnu.org/r/grub/trunk/grub/
http://bzr.savannah.gnu.org/r/grub/trunk/grub is permanently redirected to http://bzr.savannah.gnu.org/r/grub/trunk/grub/
No revisions to pull.
 * exporting ...
 * revision 3753 is now in /var/tmp/portage/sys-boot/grub-9999/work/grub-9999
>>> Source unpacked in /var/tmp/portage/sys-boot/grub-9999/work
>>> Preparing source in /var/tmp/portage/sys-boot/grub-9999/work/grub-9999 ...
Importing unicode...
Importing libgcrypt...
WARNING: C file isn't a module: ecc.c
WARNING: C file isn't a module: dsa.c
WARNING: C file isn't a module: rsa.c
WARNING: C file isn't a module: elgamal.c
WARNING: C file isn't a module: primegen.c
Creating Makefile.tpl...
Running autogen...

_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 9:39 am    Post subject: Reply with quote

I tried with ebuild 1.99-r2 and it builds fine on my system. So I guess something is broken in the repository??
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1173
Location: Austria

PostPosted: Mon Jan 16, 2012 9:43 am    Post subject: Reply with quote

Those automake warnings are the same here. They are just warnings.

As I cannot debug on your system, I cannot help you with the repo - it compiles fine here. You could try filing a bug at the grub guys.

Glad that 1.99-r2 is working for you.
_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 10:21 am    Post subject: Reply with quote

I'll try to fill a bug at grub.

I've now this issue, do you know how I should fix this?

Code:
grub2-install /dev/sda
/sbin/grub2-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!.
/sbin/grub2-setup: error: embedding is not possible, but this is required for cross-disk install.

_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Mon Jan 16, 2012 11:38 am    Post subject: Reply with quote

why are you using the 9999 version? 1.99-r2 is grub 2.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 11:49 am    Post subject: Reply with quote

Just to try.

I'm now using 1.99-r2, it compiles fine but I've still the problem from my previous post.
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Mon Jan 16, 2012 12:59 pm    Post subject: Reply with quote

digrouz wrote:
Just to try.

I'm now using 1.99-r2, it compiles fine but I've still the problem from my previous post.


let see if I got it right, grub-1.99-r2 works and gives you what you need, grub-9999 gives you what you need but doesn't works?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 1:28 pm    Post subject: Reply with quote

No, grub-9999 does not compile so we forgot it right now. So then I installed grub-1.99-r2 which compile fine. Now I have to setup it (the version 1.99-r2) on my drives but it fails and give me that error:

Code:
grub2-install /dev/sda
/sbin/grub2-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!.
/sbin/grub2-setup: error: embedding is not possible, but this is required for cross-disk install.


Sorry if it's not clear, I'm French ;)
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Mon Jan 16, 2012 1:34 pm    Post subject: Reply with quote

digrouz wrote:
No, grub-9999 does not compile so we forgot it right now. So then I installed grub-1.99-r2 which compile fine. Now I have to setup it (the version 1.99-r2) on my drives but it fails and give me that error:

Code:
grub2-install /dev/sda
/sbin/grub2-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!.
/sbin/grub2-setup: error: embedding is not possible, but this is required for cross-disk install.


Sorry if it's not clear, I'm French ;)


ignore that, run the following:
Code:
grub2-install -f /dev/sda

_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Mon Jan 16, 2012 5:51 pm    Post subject: Reply with quote

ok so it works.

Now when I try booting, I get a error message complained about a drive and then a grub rescue prompt which does not recognise any command. What Am I missing?
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Mon Jan 16, 2012 7:11 pm    Post subject: Reply with quote

post the error and conf file from /etc/grub.d/
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Tue Jan 17, 2012 4:55 am    Post subject: Reply with quote

I'm using lvm over mdadm. I've boot and root on raid1.


_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Tue Jan 17, 2012 7:02 am    Post subject: Reply with quote

sure it won't work, you have no valid entries...

follow this tutorial: http://dev.gentoo.org/~scarabeus/grub-2-guide.xml
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Tue Jan 17, 2012 7:09 am    Post subject: Reply with quote

what do you mean by no valid entry?

if I add this in 40_custom?

Code:
menuentry 'GNU/Linux, with Linux 3.1.6-gentoo' --class gnu-linux --class gnu --class os {
        load_video
        insmod gzio
        insmod ext4
        insmod raid
        insmod mdraid1x
        insmod part_gpt
        insmod part_gpt
        insmod part_gpt
        insmod part_gpt
        insmod ext2
        set root='(mduuid/5dff816788f5fb9f460428d746210f6d)'
        search --no-floppy --fs-uuid --set=root f7011cb1-a19d-4d16-add1-fc28fcefd6af
        echo    'Loading Linux 3.1.6-gentoo ...'
        linux   /kernel-3.1.6-gentoo root=/dev/mapper/rootvg-gentoolv ro   dolvm domdadm
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-3.1.6-gentoo
}
menuentry 'GNU/Linux, with Linux 3.1.6-gentoo (recovery mode)' --class gnu-linux --class gnu --class os {
        load_video
        insmod gzio
        insmod ext4
        insmod raid
        insmod mdraid1x
        insmod part_gpt
        insmod part_gpt
        insmod part_gpt
        insmod part_gpt
        insmod ext2
        set root='(mduuid/5dff816788f5fb9f460428d746210f6d)'
        search --no-floppy --fs-uuid --set=root f7011cb1-a19d-4d16-add1-fc28fcefd6af
        echo    'Loading Linux 3.1.6-gentoo ...'
        linux   /kernel-3.1.6-gentoo root=/dev/mapper/rootvg-gentoolv ro single  dolvm domdadm
        echo    'Loading initial ramdisk ...'
        initrd  /initrd-3.1.6-gentoo
}

_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Tue Jan 17, 2012 8:33 am    Post subject: Reply with quote

why insmod part_gpt more than once?

each one is an entry, in your previous config you did not had any entry as far as I could see.

add them, follow the manual and try.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Tue Jan 17, 2012 8:54 am    Post subject: Reply with quote

cut and paste error ;)

Yes previously I did not had those 2 entries. In fact I used
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
which contains those entries. I was thinking it was enough.

In fact I'm in a case not covered in that guide.

I'm using GPT but I don't have EFI based hardware. So I guess I can skip all the efi stuff, what do you think?
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5387

PostPosted: Tue Jan 17, 2012 9:34 am    Post subject: Reply with quote

digrouz wrote:
cut and paste error ;)

Yes previously I did not had those 2 entries. In fact I used
Code:
grub2-mkconfig -o /boot/grub2/grub.cfg
which contains those entries. I was thinking it was enough.

In fact I'm in a case not covered in that guide.

I'm using GPT but I don't have EFI based hardware. So I guess I can skip all the efi stuff, what do you think?


there is no logic in enabling EFI when you don't have it.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
digrouz
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2005
Posts: 124
Location: Mouscron, Belgium

PostPosted: Tue Jan 17, 2012 4:50 pm    Post subject: Reply with quote

So I tried with those entries but still the same, grub leaving me in rescue mode
_________________
There are 10 types of people in the world: those who understand binary, and those who don't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum