Mariusz Zynel
g4u is a great tool for backup/restore disks and partitions
to/from a FTP server. I will try to explain how to setup
a server to automatically boot g4u over a network.
In my setup I'm using ISC DHCP server but I believe it can be easily ported
to any implementation of dhcp server. I'm working on Solaris 10 U6 x86 but
it is not relevant here.
For your (in)convenience there is a complete set of these files
for download here:
g4u.tgz.
It contains pxeboot_ia32.bin and nfs.kmod that I have build on my own
from NetBSD-current sources as of 20.11.2011 with some minor tweak in
src/sys/arch/i386/stand/pxeboot/Makefile. Files netbsd, boot.cfg and miniroot.kmod
are taken from g4u ISO image. So, appropriate licenses apply.
You can have a more complex settings but what is listed above is the minimum.
The most important entries are:
TFTP server is only required to hand PXE loader over the net to a client machine.
The other files like: boot.cfg, netbsd, miniroot.kmod and even nfs.kmod can be
loaded over NFS. In order to do that you need one extra option in DHCP namely
telling where the files are on the NFS server. PXE loader doesn't request that
pathname from DHCP server explicitly so, we need to force DHCP server to provide
that information any way:
As you may know option code 17 is root-path. To fetch files over NFS instead
of TFTP all the prefixes
Thanks go to Hubert Feyrer, the author and maintainer of g4u, and to people from NetBSD
project.
Prerequisites
Required
Optional
Notes
Settings
banner=Welcome to g4u 2.4
banner================================================================================
banner=
banner=ACPI should work on all modern and legacy hardware, however if you have
banner=problems, please try disabling it.
banner=
menu=Boot g4u:load tftp:g4u/miniroot.kmod;boot tftp:g4u/netbsd
menu=Boot g4u (no ACPI):load tftp:g4u/miniroot.kmod;boot tftp:g4u/netbsd -2
menu=Boot g4u (no ACPI, no SMP):load tftp:g4u/miniroot.kmod;boot tftp:g4u/netbsd -12
menu=Drop to boot prompt:prompt
timeout=10
mv miniroot.kmod miniroot.kmod.gz; gunzip miniroot.kmod.gz
allow booting;
allow bootp;
filename "g4u/pxeboot_ia32.bin";
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.199;
option broadcast-address 192.168.0.255;
option subnet-mask 255.255.255.0;
option routers 192.168.0.254;
next-server 192.168.0.254;
}
if substring (option vendor-class-identifier, 0, 17) = "NetBSD:i386:libsa" {
if filename = "boot.cfg" {
filename "tftp:g4u/boot.cfg";
} elsif filename = "nfs" {
filename "tftp:g4u/nfs.kmod";
} else {
filename "";
}
}
Notes
option root-path "/tftpboot";
append dhcp-parameter-request-list 17;
tftp:
in boot.cfg and dhcpd.conf should be replaced
by the prefix nfs:
.
References
Acknowledgements
Copyright (c) 2011 by Mariusz Zynel.