X-Git-Url: https://hackdaworld.org/gitweb/?p=hdw-linux%2Fhdw-linux.git;a=blobdiff_plain;f=scripts%2FCreate-FAI;h=e88406ceb412f4f69a533eac87ab7dd784394f55;hp=046b1d3e80d278f7c991fea5fc24a12e171bc3f0;hb=b827aab00491c32a3fc9f8debaad6995d5391d83;hpb=6e75bb527068d620fe1811b09bb09e76ab29e856 diff --git a/scripts/Create-FAI b/scripts/Create-FAI index 046b1d3..e88406c 100755 --- a/scripts/Create-FAI +++ b/scripts/Create-FAI @@ -33,23 +33,29 @@ if [ ! -f ./fai/nfsroot-packages ] ; then echo "pretending default target for nfsroot install now" export hdw_target=default + echo "hdw_target=default # FAI_WAS_HERE" >> Config # dirty! ./scripts/Helper -create_dist_files export hdw_target=$hdw_orig_target + grep -v '# FAI_WAS_HERE' Config > tmp~ + mv tmp~ Config 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 + 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 + echo "adding needed packages to list now" + echo "portmap" >> ./fai/nfsroot-packages + [ "$hdw_arch" = "ia32" ] && echo "lilo" >> ./fai/nfsroot-packages +fi if [ ! -f $fairoot/packages_installed ] ; then echo "creating nfsroot..." @@ -65,23 +71,37 @@ fi if [ ! -f $fairoot/prepared_nfsroot ] ; then 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 + # special files (null & console) + [ ! -c dev/null ] && mknod -m 0666 dev/null c 1 3 + [ ! -c dev/console ] && mknod -m 0600 dev/console c 5 1 + # fstab + cp $home_dir/misc/sysfiles/etc/fstab ./etc + # the target directory mkdir -p ./trg + # dir for mounting fai config + mkdir -p fai + # removing some services for i in sysklogd network inetd nscd; do rm -f etc/init.d/rc2.d/*${i} done - sed "s%^exit\ 0%mount -tnfs $myip:/$home_dir/fai /fai%" \ - etc/init.d/rc > tmp~ - mv tmp~ etc/init.d/rc + # modified inittab, rc and bootscript + sed "s%| /sbin/btee .*%%g" $home_dir/misc/sysfiles/etc/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%" \ + $home_dir/misc/fai/fai_rc > etc/init.d/rc chmod 755 etc/init.d/rc - echo "/fai/scripts/rc_fai.sh" >> etc/init.d/rc - echo "shutdown -r now" >> etc/init.d/rc + # modify hdw-get.conf + sed "s%hdw_arch_opt=.*%hdw_arch_opt=$hdw_arch_opt%" etc/hdw-get.conf > \ + tmp~ + mv tmp~ etc/hdw-get.conf + # get to home_dir again cd $home_dir echo "done" touch $fairoot/prepared_nfsroot +else + echo "nfsroot seems to be prepared already" + echo "(del $fairoot/prepared_nfsroot to recreate it)" fi echo "checking pxe/nfs environment ..." @@ -94,11 +114,18 @@ if [ ! -f /tftpboot/pxelinux.0 ] ; then 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 ip=dhcp" >> \ - /tftpboot/pxelinux.cfg/fai -echo -e "\tPROMPT 1" >> /tftpboot/pxelinux.cfg/fai +cat > /tftpboot/pxelinux.cfg/fai << EOF +PROMPT 1 +DEFAULT disk +TIMEOUT 200 + +LABEL fai + KERNEL vmlinuz_hdw + APPEND root=/dev/nfs nfsroot=$myip:$fairoot ip=dhcp + +LABEL disk + LOCALBOOT 0 +EOF echo -e "$fairoot\tfoobar(async,ro,no_root_squash)" >> /etc/exports echo -e "$home_dir/fai\tfoobar(async,ro,no_root_squash)" >> /etc/exports