X-Git-Url: https://hackdaworld.org/gitweb/?p=hdw-linux%2Fhdw-linux.git;a=blobdiff_plain;f=scripts%2FCreate-FAI;h=b013db46e54d9e952b2aa289b43727e2e1b259e4;hp=e88406ceb412f4f69a533eac87ab7dd784394f55;hb=4dfe4bc90c6670e31d52449b3294467e879eda28;hpb=b827aab00491c32a3fc9f8debaad6995d5391d83 diff --git a/scripts/Create-FAI b/scripts/Create-FAI index e88406c..b013db4 100755 --- a/scripts/Create-FAI +++ b/scripts/Create-FAI @@ -5,19 +5,32 @@ # script creating a minimal system nfsroot for automated installation of hdw # -fairoot="$1" -myip="`ifconfig eth0 | grep inet\ addr | awk '{ print $2 }' | awk -F: '{ print $2 }'`" home_dir=$PWD +fairoot="$1" +iface="eth0" + +[ "$2" ] && iface="$2" + +myip="`ifconfig $iface | grep inet\ addr | awk '{ print $2 }' | awk -F: '{ print $2 }'`" + +if [ -z $myip ] ; then + echo "unable to figure out your ip addr." + echo "pls specify the network interface." + echo + echo "example: $0 $1 br0" + echo + exit +fi usage() { echo echo "usage:" - echo "$0 " + echo "$0 []" echo exit } -[ "$#" != "1" ] && usage +[ "$#" -lt "1" ] && usage [ ! -d $fairoot ] && usage echo "reading config ..." @@ -46,7 +59,7 @@ if [ ! -f ./fai/nfsroot-packages ] ; then echo "deleting some packages from list now" del="linux-libc-headers man-pages binutils gcc m4 autoconf automake" - del="$del man make patch bin86 nasm lilo cvs" + del="$del man make patch bin86 nasm lilo cvs devfsd" del="$del bootdisk" # just by now - may contain kernel image later for package in $del; do grep -v ^$package ./fai/nfsroot-packages > ./fai/tmp~ @@ -54,6 +67,7 @@ if [ ! -f ./fai/nfsroot-packages ] ; then done echo "adding needed packages to list now" echo "portmap" >> ./fai/nfsroot-packages + echo "tcp_wrappers" >> ./fai/nfsroot-packages [ "$hdw_arch" = "ia32" ] && echo "lilo" >> ./fai/nfsroot-packages fi @@ -85,7 +99,7 @@ if [ ! -f $fairoot/prepared_nfsroot ] ; then rm -f etc/init.d/rc2.d/*${i} done # modified inittab, rc and bootscript - sed "s%| /sbin/btee .*%%g" $home_dir/misc/sysfiles/etc/inittab > \ + sed "s%| /sbin/btee .*%%g" $home_dir/packages/base/sysvinit/inittab > \ etc/inittab cp $home_dir/misc/fai/fai_boot ./etc/init.d/boot sed "s%^FAI_MOUNT_LINE%mount -tnfs $myip:/$home_dir/fai /fai%" \ @@ -135,6 +149,7 @@ 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 "6) adapt the hdw-get.conf file in the fai nfsroot tree" echo echo "note: tftp must support tsize option (use e.g. tftp-hpa package)" echo