Bug#248864: Please document grub boot floppy building for diskless clients.
"Dr. Andreas Krüger"
"Dr. Andreas Krüger" , 248864@bugs.debian.org
Thu, 13 May 2004 15:52:46 +0200
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig31EFD189AF3178FF7C8FB5EC
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Package: grub-doc
Version: grub-doc-0.94+cvs20040429
Priority: wishlist
I want to use grub to boot a "diskless client" through tftp.
This is functionality provided by the grub software itself. But it is not
supported by the grub Debian package. Bug 106399 is already about that.
As a workaround, for the time being, I suggest at least some documentation
should be added to grub-doc, on how to go about this. This is what this bug is
about.
I have figured out one possible way (there are others), and document it in the
rest of this email. Just to be on the safe side, I place the text of this email
under the GPL, version 2 or any later version. So, if the grub maintainer
agrees this would be useful, placing this information, or something better, into
a file /usr/share/doc/grub-doc/diskless or similar, would implement the
workaround (and fix this bug).
Here is what I did to boot a diskless client through grub:
Aquire grub sources. I used "apt-get source --compile" for that. Compile did not
work, as I was not root. But before apt-get realized I wasn't root, it had
helped me to get the build dependencies straight. Besides that, it produced a
directory grubXXX with the sources unpacked.
Next, I read grubXXX/netboot/README.netboot and picked the "./configure"-options
needed for my particular setup.
I needed "--enable-diskless", of course. In my case (I wanted to resurrect old
486 type hardware) "--enable-3c509" was the ethernet driver for me.
Next, I edited file grubXXX/debian/rules. Found the place where it says
"./configure", and insert the two additional options required for my setup.
Here is the patch:
--- rules.ori 2004-05-13 13:55:07.000000000 +0200
+++ rules 2004-05-13 13:55:47.000000000 +0200
@@ -68,6 +68,8 @@
# Add here commands to configure the package.
aclocal-1.8 && automake-1.8 && autoconf
./configure \
+ --enable-diskless \
+ --enable-3c509 \
--host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/ \
Incidently, I also had my private gpg key for my email address
andreas.krueger@dv-ratio.com ready. (This may well be optional.)
I went back to the grubXXX directory, and there I ran
dpkg-buildpackage -b -m'andreas.krueger@dv-ratio.com' -rfakeroot
This created a .deb in grubXXX/.. .
For my purpose, that .deb is somewhat pointless. It contains software for the
client computer to be booted. This software is not neccessarily useful for the
host used to build grub.
I created the boot floppy for the client with
cat stage1/stage1 stage2/stage2 > /dev/fd0
This floppy I grudingly used to boot the client. Why grudingly? I have lots of
experiences with floppies not working well. Therefore, I try to avoid floppies.
Usually, I will go a long way to be able to boot from a CD, rather than from a
floppy. I could have created a full 1440 k floppy image through something like
cat stage1/stage1 stage2/stage2 /dev/zero |
dd of=boot.floppy.image bs=1k count=1440
and used some CD burning software, to produce a boot cd from that boot floppy
image. But, that particular hardware didn't even come with a CD drive. So I had
no choice, I had to use a floppy.
From this on, it is straight from the grub manual (see grub-doc).
I boot the client from the floppy.
I configure the network interface through the "dhcp" and/or "ifconfig" grub command.
I also have a tftp server up and running on the host, with a kernel and an
initrd image waiting. The kernel file's name is vmlinuz, a 2.4.x kernel in my
case, and the ramdisk image has the name initrd-diskless, and happens to be 6000
k long.
I tell grub to use the tftp server, through grub's "ifconfig --server=IP", and a
subsequent
root (nd)
After that, grub is ready to load the kernel. In my particular case, I used
kernel /bzImage-diskless ramdisk_size=6000 root=/dev/ram0 init=/linuxrc rw
Next, I have grub get the initrd through
initrd /initrd-diskless
and, finally,
boot
Regards,
Andreas
--
Dr. Andreas Krüger, andreas.krueger@dv-ratio.com
DV-RATIO Nordwest GmbH, Tel.: +49 211 577 996-0, Fax: +49 211 559 1617
Leostraße 31, 40545 Düsseldorf, Germany
--------------enig31EFD189AF3178FF7C8FB5EC
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAo32v6hmq3P1EXrcRAoPPAKCZr4GQeHnlu+OO7JM+2pvIlXyQHQCcDx4W
rcHe9RRl/1j+jlT5IWNUfHU=
=w5fK
-----END PGP SIGNATURE-----
--------------enig31EFD189AF3178FF7C8FB5EC--