how to get started with developing grub2
Greetings,
I am getting started with developing grub2 (v1.96 from debian stable) to port some grub1 custom modifications that was done on the existing products and well, I'm a bit lost.
I followed this patch thread to learn how to add a new command
http://lists.gnu.org/archive/html/grub-devel/2009-04/msg00152.html
So I ported that patch to v1.96 and run configure, make and make install (and got stuff in /usr/local)
then I go to /usr/local/bin and run grub-mkimage -o mycore.img (it it supposed to make a new /boot/grub/core.img?) then I noticed the size of the binary is smaller (/boot/grub/core.img is 24275; mine is 18242)
So what am I missing and how can I install my custom grub2 with the new/custom modules on top of my existing grub2 (still chainloading from grub1)
Apologies if this has been asked before, can't seem to find it in the mailing list. If there is any docs written on these topics somewhere, kindly point me to it.
Thank you for everyone's time.
- Richard
Quoted 18 lines · Richard Retanubun
Greetings,
I am getting started with developing grub2 (v1.96 from debian stable) to port some grub1 custom modifications
that was done on the existing products and well, I'm a bit lost.I followed this patch thread to learn how to add a new command
http://lists.gnu.org/archive/html/grub-devel/2009-04/msg00152.html
So I ported that patch to v1.96 and run configure, make and make install (and got stuff in
/usr/local)then I go to
/usr/local/binand run grub-mkimage -o mycore.img (it it supposed to make a new/boot/grub/core.img?)
then I noticed the size of the binary is smaller (/boot/grub/core.imgis 24275; mine is 18242)
Quoted 9 lines
So what am I missing and how can I install my custom grub2 with the new/custom modules on top of
my existing grub2 (still chainloading from grub1)Apologies if this has been asked before, can't seem to find it in the mailing list.
If there is any docs written on these topics somewhere, kindly point me to it.
1) First of all use the latest version. Either BZR trunk or BZR experimental branch:
http://bzr.savannah.gnu.org/r/grub/trunk/grub/ and
http://bzr.savannah.gnu.org/r/grub/branches/experimental/
In your case 'clear' command is already in since a long time.
2) Then speak before you do. It's quite possible that what you want is done with something else or by somebody else.
3) Get to develop when feature you proposed is considered good
Quoted 10 lines
Thank you for everyone's time.
- Richard
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
1) First of all use the latest version. Either BZR trunk or BZR experimental branch:
http://bzr.savannah.gnu.org/r/grub/trunk/grub/ and
http://bzr.savannah.gnu.org/r/grub/branches/experimental/
In your case 'clear' command is already in since a long time.
2) Then speak before you do. It's quite possible that what you want is done with something else or by somebody else.
3) Get to develop when feature you proposed is considered good
Hi Vladimir,
Thanks for the response,
Sorry if I am not being clear, I am using the clear command patch as a starting point/example to figure out how to port commands from grub1 to grub2, I don't actually need the command :)
The commands I am adding is very specific to our board and does not apply to general PCs so I didn't bother wasting people's time with it.
Anyhow, In case there are people following this thread, this is a solution I found (I think from a Gentoo webpage)
Howto rebuild Grub2 and reinstall it in chainload mode with Grub1
-----------------------------------------------------------------
1. Assuming your system boot with grub1 chainloading grub2 to your main os (I used debian-linux).
2. Get the grub source package on your target (I placed mine in /usr/local/src)
3. Get any build tools that you need (for debian you can use dpkg-checkbuilddeps for this)
4. run 'configure' and 'make' and then 'make install' (make install places the compiled stuff in /usr/local)
FROM [/usr/local/sbin]
6. run "grub-install --grub-setup=/bin/true /dev/hda" (the [--grub-setup=/bin/true] prevents it from being loaded into MBR and [/dev/hda] is your disk)
7. run update-grub to update /boot/grub/grub.cfg from the files in /usr/local/
8. check that /boot/grub contains new files
9. reboot, If you like the results run the update-grub-from-legacy to make it permanent
Question
--------
I may be using it wrong, but the "grub-install --grub-setup=/bin/true /dev/hda" step only worked once subsequent changes are not (re)installed and sometimes it reverts back to the unmodified grub2. Is anyone seeing this as well?? Sorry if it sounds crazy, I didn't test it very much.
Thanks for the time.
- Richard