Ticket #124 (closed task: fixed)

Opened 11 years ago

Last modified 7 years ago

Grub 1.98

Reported by: jciccone Owned by: clfs-commits@…
Priority: blocker Milestone: CLFS Standard 1.2.0
Component: BOOK Version: CLFS Standard GIT
Keywords: grub2 1.98 x86_64-64 pure64 Cc:


It's now possible to use Grub2 on 32, multilib, and pure64 if you trick configure a bit. Instructions to compile and install Grub2 are as follows:

cat > config.cache < "EOF"

Compile and install:

./configure --prefix=/usr --cache-file=config.cache &&
make &&
make install


mkdir -p /boot/grub &&
cat > /boot/grub/grub.cfg << "EOF"
set timeout=30
set default=0

menuentry "Linux" {
    linux (hd0,1)/kernel- root=/dev/hda1

Installing the bootsector.

grub-setup --directory=/boot/grub --device-map=/boot/grub/device.map /dev/hda

Comments, testing, improvements would be appreciated.

Reference:  http://lists.cross-lfs.org/pipermail/clfs-dev/2007-July/000667.html

Change History

comment:1 Changed 11 years ago by lydianknight

just creating a cache file doesn't suffice, as the compilation searchs for stubs-32.h and in my attempted build (pure64) it fails, so I can't get grub to compile, but I have to note I used a tarball grabbed from cvs, not the 1.95 version that's stored in the alpha.gnu.org site since the age of stone...

Joe, do you want me to test the 1.95 version, too?


comment:2 Changed 11 years ago by jciccone

I havn't had a chance to look at the cvs version, but I'm asuming that that was a change between the two versions. Since I don't have a stubs-32.h on my pure64 system. It couldn't hurt to verify by testing 1.95.

comment:3 Changed 11 years ago by lydianknight

Hmm... ok, I'll give it a try, but I don't know if it's the best option for me, as grub-1.95 (AFAIK) doesn't support the journal in an ext3 partition and I didn't created my pure64 on ext2 like suggested by the book...

Maybe a more suitable solution would be to write to the grub-devel mailing list and try to gather as much information as I can... the dirtiest trick I can think about is to change all references to stubs-32.h to stubs.h, but I don't know if it will work, anyway... I'll test it with the regular 1.95


comment:4 Changed 11 years ago by lydianknight


I got a response from Robert Millan, one of GRUB 2 developers, and his answer got me quite chilled... I'll post a piece of the e-mail from the grub-devel mailing list, judge for yourself:

Why are you compiling GRUB in 64-bit mode then?  It's not supported yet.

Doesn't the build system automaticaly ressort to 32-bit build for you?

Seems quite 'silly', as the code you posted for grub-1.95 works for pure64, right?

So, unless they give me a more appropiate answer, I'll try to fake the stubs-32.h file by symlinking it to our real stubs.h file and I'll see if it works, let's hope it's for good :S


comment:5 Changed 11 years ago by jciccone

It works on a pure64 system, the installer compiles fine as 64bit when you tweak the config.cache a bit. But all of the loaders are still 32bit. You don't have to install 1.95, just see if it compiles and executes properly.

comment:6 Changed 11 years ago by lydianknight

No, it still doesn't compile, but it's not exactly the presence of a stubs-32.h but the content of one of the grub headers specifing the WORDSIZE variable, as the stubs.h file defines if you're working with a wordsize of 64bits it will search for stubs-64.h while if you're working with a wordsize of 32bits it will search for stubs-32.h, so I suppose I have to locate the exact location of the WORDSIZE statement within grub code and see if I can touch it a bit...

I'll keep working on it, hope I get a decent solution to this (for the moment, I'm booting my system from a grub cd :S)


comment:7 Changed 10 years ago by jciccone

  • Version changed from CLFS Standard 1.1.0 to CLFS Standard 1.2.0
  • Milestone changed from CLFS Standard 1.1.0 to CLFS Standard 1.2.0

It's probably better to stick with lilo till after the next release.

comment:8 Changed 10 years ago by lydianknight

Yes, you're definitely right... and it's a shame, as GRUB 2 could be a far better bootloader than it currently is... looking at their mailing list archive seems to show quite a decent level of activity but apart from patches and implementations, there's not a single line about releases or anything similar...

So, for now, I've parked my attempts to make it work for x86-64, maybe at a later time, we could re-take it but for now... +1 for lilo in pure64


comment:9 Changed 10 years ago by jciccone

  • Version changed from CLFS Standard 1.2.0 to CLFS Standard SVN

comment:11 Changed 8 years ago by Cosmo

I have made a wiki page here to install grub:  http://trac.cross-lfs.org/wiki/bootloaders/grub2

I have done this on x86 32bit, If someone else can do it on x86_64 and x86_64-64 and confirms that it works then it can added to the book. If I were to just add it for x86 32bit I would have to seperate the grub pages from the x86_64 and x86_64-64 books.

comment:13 Changed 8 years ago by jciccone

  • Keywords 1.98 x86_64-64 added
  • Priority changed from minor to blocker
  • Summary changed from Grub 1.96 to Grub 1.98

Patience is a virtue, Grub 1.98 works on x86, x86_64, and x86_64 with no modifications. The book has been updated to these versions in the final systems, the boot section still needs to be re-written and verified.

At this point this ticket is a blocker since the boot section will be broken until it is updated.

comment:14 Changed 7 years ago by jciccone

  • Status changed from new to closed
  • Resolution set to fixed

The boot section should be fairly stable now. More testing needed, but will resolve this ticket. Any issues found should be opened in new tickets.

Note: See TracTickets for help on using tickets.