fixed hdw-get & fai routine
authorhackbard <hackbard>
Thu, 11 Aug 2005 14:49:30 +0000 (14:49 +0000)
committerhackbard <hackbard>
Thu, 11 Aug 2005 14:49:30 +0000 (14:49 +0000)
doc/CHANGELOG
misc/fai/fai_boot
misc/hdw-tools/hdw-get
scripts/Create-FAI

index eee898f..bd33f82 100644 (file)
@@ -1,5 +1,6 @@
 *) 2005-08-11
 
 *) 2005-08-11
 
+- fixes to fai routine, improved hdw-get
 - several package updates (stage 4)
 - xdirectfb changes (adapted from malis notebook)
 
 - several package updates (stage 4)
 - xdirectfb changes (adapted from malis notebook)
 
index b829d34..c00d2a4 100755 (executable)
@@ -77,5 +77,5 @@ echo "start of FAI (fully automated installation) process, good luck ..."
 echo
 echo
 echo -en "starting portmap ..."
 echo
 echo
 echo -en "starting portmap ..."
-/usr/sbin/portmap
+/sbin/portmap
 echo " done"
 echo " done"
index fa08cb1..0360306 100644 (file)
@@ -11,12 +11,14 @@ usage()     {
        echo "usage:"
        echo "$0 [install/remove] [root] [package]"
        echo "$0 [dist-install] [root] [dist file]"
        echo "usage:"
        echo "$0 [install/remove] [root] [package]"
        echo "$0 [dist-install] [root] [dist file]"
+       echo "$0 [update]"
        echo
        echo "options:"
        echo "-v        tell me whats going on"
        echo "-a        auto resolve deps, do not prompt user"
        echo "-no-dep   do not care for dependencies (used by hdw-get itself)"
        echo "-s        simulation only, do not install/remove packages"
        echo
        echo "options:"
        echo "-v        tell me whats going on"
        echo "-a        auto resolve deps, do not prompt user"
        echo "-no-dep   do not care for dependencies (used by hdw-get itself)"
        echo "-s        simulation only, do not install/remove packages"
+       echo "-b        base package, not listed in hdw-get.db"
        echo
 }
 
        echo
 }
 
@@ -26,6 +28,7 @@ d_install="" ; install=""
 verbose="" ; no_dep=""
 auto_resolve_deps=""
 simulate=""
 verbose="" ; no_dep=""
 auto_resolve_deps=""
 simulate=""
+base=""
 
 FL_DIR="var/adm/flists"
 DEPS_DIR="var/adm/deps/run"
 
 FL_DIR="var/adm/flists"
 DEPS_DIR="var/adm/deps/run"
@@ -46,6 +49,7 @@ while [ "$1" ] ; do
                -a)             auto_resolve_deps="1" ; shift 1 ;;
                -no-dep)        no_dep="1" ; shift 1 ;;
                -s)             simulate="1" ; shift 1 ;;
                -a)             auto_resolve_deps="1" ; shift 1 ;;
                -no-dep)        no_dep="1" ; shift 1 ;;
                -s)             simulate="1" ; shift 1 ;;
+               -b)             base="1" ; no_dep="1" ; shift 1;;
                *)              usage ; exit 1 ;;
        esac
 done
                *)              usage ; exit 1 ;;
        esac
 done
@@ -175,14 +179,16 @@ elif [ "$install" = "1" ] ; then
        fi
 
        # package in database?
        fi
 
        # package in database?
-       if [ "`grep "^$pkg\ -" $DBF`" = "" ] ; then
-               echo "sorry, package $package not found ..."
-               echo "(use 'hdw-get update' to update database)"
-               exit 1
+       if [ -z $base ] ; then
+               if [ "`grep "^$pkg\ -" $DBF`" = "" ] ; then
+                       echo "sorry, package $package not found ..."
+                       echo "(use 'hdw-get update' to update database)"
+                       exit 1
+               fi
        fi
 
        # check for runtime deps
        fi
 
        # check for runtime deps
-       if [ -z $no_deps ] ; then
+       if [ -z $no_dep ] ; then
                deps="`grep "^$pkg\ -" $DBF | sed 's/.* -//'`"
                udeps=""
                tudeps=""
                deps="`grep "^$pkg\ -" $DBF | sed 's/.* -//'`"
                udeps=""
                tudeps=""
@@ -271,7 +277,7 @@ elif [ "$d_install" = "1" ] ; then
                # install all distribution related packages
                for package in `cat $dist_file`; do
                        # execute myelf
                # install all distribution related packages
                for package in `cat $dist_file`; do
                        # execute myelf
-                       $0 install $inst_root $package
+                       $0 -b install $inst_root $package
                done
        fi
 fi
                done
        fi
 fi
index e88406c..36e4996 100755 (executable)
@@ -5,19 +5,32 @@
 # script creating a minimal system nfsroot for automated installation of hdw
 #
 
 # 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
 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:"
 
 usage()        {
        echo
        echo "usage:"
-       echo "$0 <fai-root>"
+       echo "$0 <fai-root> [<network interface>]"
        echo
        exit
        }
 
        echo
        exit
        }
 
-[ "$#" != "1" ] && usage
+[ "$#" -lt "1" ] && usage
 [ ! -d $fairoot ] && usage
 
 echo "reading config ..."
 [ ! -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"
 
        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~
        del="$del bootdisk" # just by now - may contain kernel image later
        for package in $del; do
                grep -v ^$package ./fai/nfsroot-packages > ./fai/tmp~
@@ -85,7 +98,7 @@ if [ ! -f $fairoot/prepared_nfsroot ] ; then
                rm -f etc/init.d/rc2.d/*${i}
        done
        # modified inittab, rc and bootscript
                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%" \
                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%" \