SuSE Linux: Versions since 8.1
In the following example scenario, a Linux installation or a recovery system is loaded from the network. For this purpose, a GRUB boot floppy is used to start a client. The files that Linux requires for booting (kernel, initrd) are transferred by GRUB through the tftp protocol. All other files are transferred from a server via ftp or nfs.
It would also be possible to load a Linux operating system and to operate the client as a diskless client. This configuration exceeds the scope of this article, however.
rpm -Uhv /media/cdrom/suse/src/grub-0.92-69.src.rpmThen you will find a tarball in the directory /usr/src/packages/SOURCES/. The file netboot/README.netboot in this tarball contains the parameters to compile the support for each network card. Extract this file to the directory /tmp by executing a command similar to the following one (you might have to adjust the GRUB package's version number):
tar -xOjf /usr/src/packages/SOURCES/grub-0.92.tar.bz2 grub-*/netboot/README.netboot >/tmp/README.netbootFor example, for an Intel Ethernet Pro 100 the parameter "--enable-eepro100" is required. It is advisable to activate only the drivers that are actually required, because too many compiled network card drivers might make GRUB crash.
Edit the spec file at /usr/src/packages/SPECS/grub.spec with an ASCII editor of your choice and insert the parameter for your network card support. For example:
%build %ifarch x86_64 export CC='cc -m32' CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DNDEBUG -W -Wall -Wpointer-arith -fno-asynchronous-unwind-tables" ./configure \ --prefix=/usr --infodir=%{_infodir} --mandir=%{_mandir} --datadir=/usr/lib/grub \ --disable-auto-linux-mem-opt --enable-diskless --enable-eepro100 %else CFLAGS="$CFLAGS $RPM_OPT_FLAGS -DNDEBUG -W -Wall -Wpointer-arith" ./configure \ --prefix=/usr --infodir=%{_infodir} --mandir=%{_mandir} --datadir=/usr/lib/grub \ --disable-auto-linux-mem-opt --enable-diskless --enable-eepro100 %endif makeIncrease the release number at the top of the spec file, e.g.:
Release: 70Then save the spec file and recompile:
rpm -bb /usr/src/packages/SPECS/grub.specand install the package:
rpm -Uhv /usr/src/packages/RPMS/i386/grub-0.92-70.i386.rpmNow create a GRUB boot floppy as follows:
cd /usr/lib/grub/ dd if=stage1 of=/dev/fd0 dd if=stage2 of=/dev/fd0 seek=1By executing these commands, GRUB's first and second level are directly written on a floppy disk in block form.
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/atftpd /tftpbootThe rescue system can be installed or loaded via ftp or nfs. The following lines describe the configuration of an FTP server. Install the packages vsftpd and ftpdir. To activate the FTP server, edit the file /etc/inetd.conf: remove the comment line from the entry
ftp stream tcp nowait root /usr/sbin/tcpd vsftpdActivate the inetd by executing
rcinetd startYou can use the command insserv inetd or the runlevel editor to make inetd start automatically at the boot process. For more information about the configuration of server services, refer to the administration manual.
To release SuSE installation files for share, copy the content of the CD or DVD to the directory /srv/ftp/pub or to a subdirectory. Alternatively, the DVD or the first CD can be mounted at the mount point /srv/ftp/pub:
mount -t iso9660 -o ro /dev/cdrom /srv/ftp/pub/
grub >Inform GRUB about the client IP address, netmask, and server address with:
grub > ifconfig --address=192.168.0.2 --mask=255.255.255.0 --server=192.168.0.1If a DHCP, BOOTP, or RARP server is running on the server, you can automatically allocate the IP address, for example with the following command in the case of DHCP:
grub > dhcpIn the next step, inform GRUB that the boot files must be loaded from the network (nd stands for "network drive"):
grub > root (nd)Now the kernel will be loaded. The installation source is provided to linuxrc by means of an additional parameter:
grub > kernel /linux install=ftp://192.168.0.1/pub/The kernel linux is loaded from the root directory of the tftp server. The installation files loaded via ftp from the directory /pub on the server with the IP 192.168.0.1.
To load SuSE rescue system instead of the installation, append the parameter rescue=1 to the line. If the files should be loaded via NFS, the syntax is install=nfs://server/directory/. For some network cards, it might be necessary to load the network card module explicitly to start linuxrc. In this case, add the parameter insmod=module_name, replacing module_name with the corresponding kernel module. For example, for an Intel EtherExpress PRO/100:
grub > kernel /linux insmod=e100 install=ftp://192.168.0.1/pub/If the package linuxrc is installed, find additional parameters for the installation in the file usr/share/doc/packages/linuxrc/linuxrc.html.
The initrd is loaded after the kernel:
grub > initrd /initrdFinally, boot the system with the command
grub > bootIf everything has been correctly configured, the installation or the rescue system should start now.
gfxmenu (nd)/message color white/blue black/light-gray default 1 timeout 8 title SuSE Linux Installation kernel (nd)/linux insmod=e100 install=ftp://192.168.0.1/pub/ initrd (nd)/initrd title SuSE Linux Rescue System kernel (nd)/linux insmod=e100 install=ftp://192.168.0.1/pub/ rescue=1 initrd (nd)/initrd title Booting from local hard disk root (hd0) chainloader +1Boot the client with GRUB boot floppy and configure the network by executing the usual ifconfig command:
grub > ifconfig --address=192.168.0.2 --mask=255.255.255.0 --server=192.168.0.1or by means of:
grub > dhcpTo load the menu, enter:
grub > configfile (nd)/menu.lstNow, view the ordinary SuSE boot menu in which to select the requested option.
earth:~ # mke2fs -m 0 /dev/fd0The floppy must be mounted so the necessary boot files can be copied:
earth:~ # mount /media/floppy/ earth:~ # cp /usr/lib/grub/stage1 /usr/lib/grub/stage2 /media/floppy/Copy the file /tftboot/menu.lst previously created to the floppy. Adjust the newly-created file /media/floppy/menu.lst by inserting the network configuration at the top of the file (the dhcp or ifconfig command):
dhcp gfxmenu (nd)/message color white/blue black/light-gray default 1 timeout 8 title SuSE Linux Installation kernel (nd)/linux insmod=e100 install=ftp://192.168.0.1/pub/ initrd (nd)/initrd title SuSE Linux Rescue System kernel (nd)/linux insmod=e100 install=ftp://192.168.0.1/pub/ rescue=1 initrd (nd)/initrd title Booting from local hard disk root (hd0) chainloader +1To make the boot floppy bootable, enter the command grub in a shell:
earth:~ # grubNow you are in a grub shell. By executing the following command, the file stage1 located on the floppy will be written to the floppy's boot sector. stage2 and the configuration file menu.lst, both also located on the floppy, are passed as parameters:
grub > install (fd0)/stage1 (fd0) (fd0)/stage2 p (fd0)/menu.lstQuit the grub shell with:
grub > quitThen unmount the floppy:
earth:~ # umount /media/floppyIf everything has worked, the configuration will be completely loaded from the floppy during the boot process.
For additional information about GRUB, refer to http://www.gnu.org/manual/grub/html_mono/grub.html. View the same information on your installed system by executing the command info grub in a shell. If the kernel sources are installed (package kernel-source), refer to the file /usr/src/linux/Documentation/nfsroot.txt for more information about a Linux start as a diskless client (kernel parameter to boot from NFS).
This subject exceeds the scope of the free-of-charge installation support.
SDB-fhassel_grub_net
)