Compiling and installing GRUB

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Compiling and installing GRUB

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

"make install" as well?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post 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
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post 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
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post 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
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post 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.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post 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
Post Reply