From 279a8b0643080f522eb4b0eb515229f21159ea2f Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 5 Dec 2004 23:59:22 +0000 Subject: [PATCH] CHANGELOG 2004-12-06 --- doc/CHANGELOG | 6 ++ doc/FAI | 15 ++--- misc/hdw-tools/hdw-get | 1 + packages/ia32/syslinux/syslinux | 4 +- packages/net/tftp-hpa/tftp-hpa | 4 +- scripts/Create-FAI | 107 ++++++++++++++++++++++++++++++-- 6 files changed, 118 insertions(+), 19 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 61c73dd..f461cc8 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,9 @@ +*) 2004-12-6 + +- further work on fai +- updated tftp-hpa and syslinux package +- added exit statement to hdw-get file + *) 2004-10-31 - some lines adding general mips support diff --git a/doc/FAI b/doc/FAI index 2cbfa00..180ae6e 100644 --- a/doc/FAI +++ b/doc/FAI @@ -16,7 +16,6 @@ procedure --------- 1) install mnimal nfsroot binaries - (as described in INSTALL chapter 2.) vi Config [enter default as a target, specify arch*] @@ -25,17 +24,9 @@ procedure the install process. fai-server is actually the target you will need as a running system to have pxeboot/nfsutils and stuff. - ./scripts/Helper -create_dist_files - ./misc/hdw-tools/hdw-get dist-install /mnt/fai-root \ - ./distro/default + ./scripts/Create-FAI - 2) prepare nfsroot & mount ./fai dir via loopback for configurations - - ./scripts/Create-FAI /mnt/fai-root - - 4) adapt configs in ./fai (see chapter "fai config files") - - 3) edit the following files to match your needs, and restart services + 2) edit the following files to match your needs, and restart services /etc/dhcpd.conf /etc/inetd.conf @@ -44,6 +35,8 @@ procedure (have a look at chapter "fai server configuration") + 3) adapt configs in ./fai (see chapter "fai config files") + 4) pxeboot your install candidates and watch installation diff --git a/misc/hdw-tools/hdw-get b/misc/hdw-tools/hdw-get index 0aa2a3b..10be612 100644 --- a/misc/hdw-tools/hdw-get +++ b/misc/hdw-tools/hdw-get @@ -170,6 +170,7 @@ elif [ "$install" = "1" ] ; then retval=$? if [ "$retval" != "0" ] ; then echo "package not found at $net_addr, aborting ..." + exit else echo "extracting $package to $inst_root ..." tar --use-compress-program=bzip2 \ diff --git a/packages/ia32/syslinux/syslinux b/packages/ia32/syslinux/syslinux index 297c61c..fce7ebc 100644 --- a/packages/ia32/syslinux/syslinux +++ b/packages/ia32/syslinux/syslinux @@ -2,9 +2,9 @@ # # author: hackbard@hackdaworld.dyndns.org # -# [V] 2.10 +# [V] 2.11 # [S] 3-6 -# [D] syslinux-2.10.tar.bz2 http://kernel.org/pub/linux/utils/boot/syslinux/ +# [D] syslinux-2.11.tar.bz2 http://kernel.org/pub/linux/utils/boot/syslinux/ post_install() { rm -rf $docdir diff --git a/packages/net/tftp-hpa/tftp-hpa b/packages/net/tftp-hpa/tftp-hpa index e29796e..46f0ad2 100644 --- a/packages/net/tftp-hpa/tftp-hpa +++ b/packages/net/tftp-hpa/tftp-hpa @@ -3,5 +3,5 @@ # author: hackbard # [S] 3-2 -# [V] 0.36 -# [D] tftp-hpa-0.36.tar.bz2 ftp://www.kernel.org/pub/software/network/tftp/ +# [V] 0.40 +# [D] tftp-hpa-0.40.tar.bz2 ftp://www.kernel.org/pub/software/network/tftp/ diff --git a/scripts/Create-FAI b/scripts/Create-FAI index cc3e6e6..1b3366e 100755 --- a/scripts/Create-FAI +++ b/scripts/Create-FAI @@ -6,17 +6,116 @@ # fairoot="$1" +myip="`ifconfig eth0 | grep inet\ addr | awk '{ print $3 }' | awk -F: '{ print $2 }'`" +home_dir=$PWD usage() { echo echo "usage:" - echo "$1 " + echo "$0 " echo exit } -if [ ! -d $fairoot -o ] ; then - usage +[ "$#" != "1" ] && usage +[ ! -d $fairoot ] && usage + +echo "reading config ..." +if [ ! -f ./Config ] ; then + echo "config file not found, aborting" + exit +fi +. ./Config + +if [ ! -d ./fai ] ; then + echo "creating fai directory" + mkdir ./fai +fi + +if [ ! -f ./fai/nfsroot-packages ] ; then + echo "storing $hdw_target as original target" + hdw_orig_target=$hdw_target + + echo "pretending default target for nfsroot install now" + export hdw_target=default + + ./scripts/Helper -create_dist_files + + export hdw_target=$hdw_orig_target + echo "orig target restored to $hdw_target" + + cp ./distro/default ./fai/nfsroot-packages +fi + +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 bootdisk" # just by now - may contain kernel image later +for package in $del; do + grep -v ^$package ./fai/nfsroot-packages > ./fai/tmp~ + mv ./fai/tmp~ ./fai/nfsroot-packages +done + +if [ ! -f $fairoot/packages_installed ] ; then + echo "creating nfsroot..." + chmod 755 ./misc/hdw-tools/hdw-get + ./misc/hdw-tools/hdw-get dist-install $fairoot ./fai/nfsroot-packages + touch $fairoot/packages_installed + echo "done" +else + echo "nfsroot seems to be available already" + echo "(del $fairoot/packages_installed to recreate it)" fi -echo "preparing + +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" -- 2.39.2