Page 1 of 1

Compiling and installing GRUB

Posted: Thu Dec 20, 2007 4:41 pm
by jal
I'm trying to compile a version of GRUB that correctly passes VBE info to the kernel via the multiboot structure. After compiling, I want to install this version in my diskimage, which I have mounted via a loopback device. The problem is, that I don't want this version installed on my Linux partition, just in some directory. I can specify the --prefix when I run the configure script, and it seems to install nicely in the directory I indicate there, but how do I install from that directory onto my diskimage (or a real floppy, for that matter)? If I run grub from the sbin directory, it segfaults. Does this mean my build is somehow corrupt, or does it segfault because it's in an unexpected location? I expect the former, as it reports a negative amount of memory, but how to compile GRUB then? I just ran configure, then make. Any help would be greatly appreciated.


JAL

Posted: Fri Dec 21, 2007 4:25 am
by Combuster
"make install" as well?

Posted: Fri Dec 21, 2007 4:42 am
by jal
Combuster wrote:"make install" as well?
Yes, I did a make install. But I used a different install directory of course, I don't want to overwrite my current GRUB I use to boot my PC. Besides, even without a "make install" I wouldn't expect segfaulting.


JAL

Posted: Mon Dec 24, 2007 3:47 am
by jal
Mmm, downloaded another version of the GRUB source, and compiled on a different (in this case virtual) machine. Same problem there, segfaulting when starting. Has anyone compiled GRUB on Ubuntu with success? I'd like to hear what you did to make it work.


JAL

Posted: Mon Dec 24, 2007 6:04 am
by binutils

Posted: Mon Dec 24, 2007 7:20 am
by jal
binutils wrote:http://www.linuxfromscratch.org/lfs/view/stable/chapter06/grub.html
That's basically what I did. But bochs keeps rebooting if I do this. And the grub executable itself segfaults.


JAL

Posted: Mon Dec 24, 2007 6:01 pm
by binutils
check your compiler and glibc, imo, it should work.
does it works with other c sources?

--
PS: grub 0.97 doesn't works if compiler is 64bit in some condition.
if so, check grub 2.x or lilo.

Posted: Thu Dec 27, 2007 9:48 am
by jal
binutils wrote:check your compiler and glibc, imo, it should work.
does it works with other c sources?
I use GCC from a standard Ubuntu install. I may have installed some additional packages as well, cannot remember. And yes, GCC works without a problem, I have succesfully compiled Bochs, for example.


JAL