All of lore.kernel.org
 help / color / mirror / Atom feed
* how to get started with developing grub2
@ 2010-02-17 14:20 Richard Retanubun
  2010-02-17 18:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Retanubun @ 2010-02-17 14:20 UTC (permalink / raw)
  To: grub-devel

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to get started with developing grub2
  2010-02-17 14:20 how to get started with developing grub2 Richard Retanubun
@ 2010-02-17 18:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
  2010-02-18 22:18   ` Richard Retanubun
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-02-17 18:27 UTC (permalink / raw)
  To: The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1763 bytes --]

Richard Retanubun wrote:
> 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.
>
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
> Thank you for everyone's time.
>
> - Richard
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to get started with developing grub2
  2010-02-17 18:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-02-18 22:18   ` Richard Retanubun
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Retanubun @ 2010-02-18 22:18 UTC (permalink / raw)
  To: The development of GNU GRUB

Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-18 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-17 14:20 how to get started with developing grub2 Richard Retanubun
2010-02-17 18:27 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-18 22:18   ` Richard Retanubun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.