BOOTING/INSTALLING CRUX LINUX WITH PXE NETWORK CARDS Documentation ============= Software ======== * The ISC DHCP Server (dhcp) * Trivial Ftp Daemon (tftp-hpa) * NFS Server (nfs-utils) * dosfstools (needed for syslinux) * netpbm (needed for syslinux) * syslinux Configuring =========== +------+ | TFTP | +------+ Create the directory /tftpboot with 755 permissions: $ mkdir /tftpboot $ chmod 755 /tftpboot Since we want to chroot into /tftpboot we have create a symlink to the directory itself: $ cd /tftpboot $ ln -s . tftpboot Enable the tftp daemon in your /etc/inetd.conf: ---snip--- tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot -r blksize ---snap--- The option -s causes the tftpd to chroot into /tftpboot. Restart your inetd: $ pkill -HUP inetd +------+ | DHCP | +------+ The minimum information you need to put in /etc/dhcpd.conf is: 1. The domain name of the machine. 2. The Ethernet (MAC) address of the network card, which you generally obtain from a sticker bumped on the card. 3. The path of your pxeboot boot image (/tftpboot/pxelinux.0). 4. The IP address you intend to give. 5. The name and path of your install-server (NFS: 192.168.0.1:/crux) 6. The TFTP server defaults to the DHCP server if not specified with next-server. Here is a sample DHCP configuration for ISC dhcpd: ---snip--- not authoritative; # Maybe there are some other # dhcp server. allow booting; allow bootp; next-server 192.168.0.10; # TFTP/PXE Server option domain-name "mycrux.net"; option domain-name-servers 192.168.0.5; option routers 192.168.0.1; option broadcast-address 192.168.0.255; ddns-update-style none; use-host-decl-names on; subnet 192.168.0.0 netmask 255.255.255.0 { filename "/tftpboot/pxelinux.0"; option root-path "192.168.0.10:/crux"; host adlerauge { # host "eagle's eye" hardware ethernet 00:30:64:00:f1:9a; fixed-address 192.168.0.243; } } ---snap--- Start the DHCP Server with: $ /etc/rc.d/dhcpd start +-----+ | NFS | +-----+ Create the directory /crux with the permissions 755. $ mkdir /crux $ chmod 755 /crux Edit your /etc/exports file and add the following line: ---snip--- /crux *(ro,no_root_squash,async) ---snap--- Be sure to have also the required entry in /etc/hosts.allow. ---snip--- portmap in.tftpd rpc.mountd mountd rpc.lockd lockd rpc.nfsd nfsd : 127.0.0.1 LOCAL 192.168.0.0/255.255.255.0 : ALLOW ---snap--- Start the NFS Server: $ /etc/rc.d/portmap start $ /etc/rc.d/nfs start +----------------------------------+ | Setting up the CRUX release area | +----------------------------------+ Mount the CDROM/CDROM Image somewhere: $ mount /dev/cdroms/cdrom0 /mnt or $ mount -o loop /home/joe/crux-i586-2.1.iso /mnt (Your kernel needs 'Block devices ---> <*> Loopback device support' compiled in to be able to mount CD-ROM images.) Copy the whole CD into the release area: $ cp -r /mnt/* /crux/ Some changes in '/crux/etc/rc': $ cd $ vi etc/rc ---snip--- @@ -17,6 +17,10 @@ /bin/mkdir /var/lock /var/log /var/run /var/tmp /bin/touch /var/run/utmp +# Copy/mount /etc to make it writeable +/bin/cp -r /etc /tmp/ +/bin/mount --bind /tmp/etc /etc + # Start log daemons /usr/sbin/syslogd /usr/sbin/klogd -c 4 ---snap--- +----------------------------+ | Configure your boot kernel | +----------------------------+ Download the crux boot-kernel configuration file and put it to your kernel source tree. File: ftp://ftp.fukt.bth.se/pub/os/linux/crux/latest/misc/bootkernel-2.4.20.config $ cp /home/joe/bootkernel-2.4.20.config /usr/src/linux-2.4.20/.config Configure your kernel. $ make menuconfig Don't forget to enable the following kernel features: * "Networking options" - "TCP/IP networking" -"kernel-level autoconfiguration" * "File systems" - "Network File Systems" - "NFS file system support" * "File systems" - "Network File Systems" - "Root file system on NFS" * "Network device support" - add your network interface card(s) +----------------------------+ | Preparing TFTP environment | +----------------------------+ Copy the kernel & the pxelinux.0 file into /tftpboot $ cp /usr/src/linux-2.4.20/arch/i386/boot/bzImage /tftpboot/vmlinuz $ cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ Write a small boot message and save it to /tftpboot/boot.msg: $ echo "Woohoo ... My PXE install server is running." > /tftpboot/boot.msg Create the syslinux PXE configuration directory "pxelinux.cfg": $ mkdir /tftpboot/pxelinux.cfg Finally put the syslinux configuration file 'default' into /tftpboot/pxelinux.cfg/: $ cp /home/joe/syslinux.cfg /tftpboot/pxelinux.cfg/default ---snip--- DEFAULT vmlinuz APPEND root=/dev/nfs nfsroot=192.168.0.10:/crux init=/sbin/init IPAPPEND 1 TIMEOUT 300 PROMPT 1 DISPLAY boot.msg ---snap---