+
+echo "preparing nfsroot for automated install routine ..."
+
+cd $fairoot
+
+mknod -m 0666 dev/null c 1 3
+mknod -m 0600 dev/console c 5 1
+
+grep -v swap etc/fstab > tmp~
+mv tmp~ etc/fstab
+
+for i in sysklogd network inetd nscd; do
+ rm -f etc/init.d/rc2.d/*${i}
+done
+
+cd $home_dir
+
+echo "done"
+
+echo "checking pxe/nfs environment ..."
+mkdir -p /tftpboot
+cp $fairoot/boot/vmlinuz_hdw /tftpboot
+if [ ! -f /tftpboot/pxelinux.0 ] ; then
+ if [ ! -f /usr/lib/syslinux/pxelinux.0 ] ; then
+ echo "pxelinux (syslinux) not found, fix this manually now :p"
+ fi
+ cp /usr/lib/syslinux/pxelinux.0 /tftpboot
+fi
+mkdir -p /tftpboot/pxelinux.cfg
+echo -e "LABEL fai" > /tftpboot/pxelinux.cfg/fai
+echo -e "\tKERNEL vmlinuz_hdw" >> /tftpboot/pxelinux.cfg/fai
+echo -e "\tAPPEND root=/dev/nfs nfsroot=$myip:$fairoot \\" >> \
+ /tftpboot/pxelinux.cfg/fai
+echo -e "\tip=dhcp" >> /tftpboot/pxelinux.cfg/fai
+echo -e "\tPROMPT 1" >> /tftpboot/pxelinux.cfg/fai
+echo -e "$fairoot\tfoobar(async,ro,no_root_squash)" >> /etc/exports
+
+echo "mounting configuration dir to nfsroot export ..."
+mkdir -p $fairoot/fai-config
+mount --bind $PWD/fai $fairoot/fai-config
+
+echo "everything should work now. now do the following:"
+echo "1) edit /etc/exports to allow your clients to mount the nfsroot"
+echo "2) link the ipaddr in hex of the client to fai in pxe config dir"
+echo "3) tell your dhcpd (see syslinux docs for more help)"
+echo "4) make sure inetd/nfs/dhcpd are up running"
+echo "5) do the configuration stuff (see doc/FAI)"
+echo
+echo "note: tftp must support tsize option (use e.g. tftp-hpa package)
+echo
+
+echo "done"