minimal fixes ;) - should work now - semi automatic :))
[hdw-linux/hdw-linux.git] / fai / scripts / rc_fai.sh
index 192c63f..a839f69 100755 (executable)
@@ -9,7 +9,6 @@ root=/trg
 croot=/fai/config
 myip="`ifconfig eth0 | grep inet\ addr | awk '{ print $2 }' | awk -F: '{ print $2 }'`"
 myconf=$croot/$myip
-proot=""
 
 if [ ! -d $myconf ] ; then
        echo "no config found, aborting fai"
@@ -28,15 +27,15 @@ mount -tramfs ramfs /tmp
 #
 # check if disk is ready
 #
-if [ ! -f $croot/$myip/disk_ready ] ; then
+if [ ! -f $myconf/disk_ready ] ; then
        echo
        echo "you're disk seems to not be ready. login now and use cfdisk"
        echo "to partition your harddisk. please make sure it's compatible"
-       echo "to $croot/$myip/disk:"
-       cat $croot/$myip/disk
+       echo "to $myconf/disk:"
+       cat $myconf/disk
        echo
        echo "after partitioning your harddisk please touch the file"
-       echo "$croot/$myip/disk_ready"
+       echo "$myconf/disk_ready"
        echo "on your fai install server and reboot."
        echo "... fully automated, he? :p"
        echo
@@ -75,7 +74,6 @@ cat $myconf/disk | grep -v '^#' | while read nr mp fs ac; do
                        grep -v '/dev/root' /etc/fstab > $root/etc/fstab
                        echo -e "${disk}${nr}\t$mp\t$fs\tdefaults 0 2" >> \
                                $root/etc/fstab
-                       proot=${disk}${nr}
                fi
        fi
 done
@@ -97,7 +95,7 @@ cp $root/etc/fstab $root/etc/fstab~
 #
 cd /tmp # we need to wget stuff!
 pkglist=""
-[ -f /fai/config/$myip/packages ] && pkglist=/fai/config/$myip/packages
+[ -f $myconf/packages ] && pkglist=$myconf/packages
 if [ -z "$pkglist" ] ; then
        echo "cant find package list for $myip, aborting"
        exit
@@ -127,6 +125,8 @@ done
 #
 # lilo
 #
+proot=${disk}`grep /[^a-z,^A-Z] $myconf/disk | awk '{ print $1 }'`
+echo "running lilo -> root device = $proot"
 cat > $root/etc/lilo.conf << EOF
 boot=$disk
 prompt
@@ -146,8 +146,9 @@ cat > $root/run_lilo.sh << EOF
 mount /dev
 mount /sys
 mount /proc
+mkdir -p /dev/shm && mount /dev/shm
+mkdir -p /dev/pts && mount /dev/pts
 udevstart
-mount -a
 ln -s /proc/self/fd /dev/fd
 ln -s /proc/self/fd/0 /dev/stdin
 ln -s /proc/self/fd/1 /dev/stdout