bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

submitting two small features


From: Pierre Letouzey
Subject: submitting two small features
Date: Sun, 2 Mar 2003 05:53:27 +0100 (MET)

First, I would like to thank the grub development team for their work:
grub is really cool...

Some time ago, I adapted slightly grub to my need, for administrating
a network of Linux diskless clients. In case you find my modifications
interesting, I attached two corresponding patches.

=======================================================================
My first patch is maybe too specific to be included in grub source:
the issue was to get a client-specific configfile via network
without using the dhcp --configfile (because in my case, dhcp was already
used by Windows on the same network). So I added an option to configfile:

  configfile --with-mac foo

With this option, grub gets the file foo.xx:xx:xx:xx:xx:xx instead of foo,
where xx:xx:xx:xx:xx:xx is the MAC address of the client.
=======================================================================
My second patch is more general, and might interest other people.
Imagine a diskless client booting via grub. It configures its network
(via rarp in my case), gets its vmlinuz via tftp, then boot it ... and
then vmlinuz ask again its ip via rarp. My small hack avoids this double
IP resolution:

  kernel --keep-ip my_vmlinuz

With this option, my_vmlinuz is launched with ip=IP:SERVER:GATEWAY:NETMASK
added on its command line, where IP, SERVER, GATEWAY, NETMASK are the
values previously determined by grub.
NOTE: of course, works only with Linux
========================================================================

More generally, <DREAM> it would be great to have some kind of
variable expansion in grub configfile/cmdline, at least for basic
variables like $MAC or $IP ... </DREAM>. But I know we cannot embbed a
complete shell inside grub ;)


I also used during a few weeks an ugly hack to replace the usual IP
resolution protocols: I included inside the grub source a static
file containing a big struct of all pairs (MAC,IP) of my network.
Determining the IP was just looking in that table. But that's not a good
solution: any change in the network leads to recompilation.
A clean version of that would be to allow grub to read an external file,
for example in the /etc/ethers format. I will maybe code that one day...

Bye

Pierre Letouzey

----------------------------------------------
Laboratoire de Recherche en Informatique
LRI, Universite Paris Sud, Orsay 91405, France
http://www.lri.fr/~letouzey
----------------------------------------------

Attachment: patch_with-mac_0.93.gz
Description: Binary data

Attachment: patch_keep-ip_0.93.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]