fixed fai file copying
[hdw-linux/hdw-linux.git] / fai / scripts / rc_fai.sh
index a839f69..1947361 100755 (executable)
@@ -87,6 +87,8 @@ cat $myconf/disk | grep -v '^#' | while read nr mp fs ac; do
                fi
        fi
 done
+[ "$swap" != "0" -a -b ${disk}${swap} ] && \
+       echo -e "${disk}${swap}\tswap\tswap\tdefaults 0 0" >> $root/etc/fstab
 # packages might install new fstab file, stored.
 cp $root/etc/fstab $root/etc/fstab~
 
@@ -112,7 +114,11 @@ cd /fai/files
 for file in `find -type f | grep -v CVS`; do
        srcf=`basename $file`
        trgf=`dirname $file`
-       [ "$srcf" = "DEFAULT" -o "$srcf" = "$myip" ] && cp -v $file $root/$trgf
+       trgdir=`dirname $trgf`
+       if [ "$srcf" = "DEFAULT" -o "$srcf" = "$myip" ] ; then
+               mkdir -p $root/$trgdir
+               cp -v $file $root/$trgf
+       fi
 done
 
 #