[Fai-commit] r3999 - trunk/examples/simple/scripts/FAIBASE

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Thu Sep 21 13:49:41 UTC 2006


Author: lange
Date: 2006-09-21 13:49:41 +0000 (Thu, 21 Sep 2006)
New Revision: 3999

Modified:
   trunk/examples/simple/scripts/FAIBASE/20-removable_media
   trunk/examples/simple/scripts/FAIBASE/40-misc
Log:
use new ainsl command for adding lines to fstab,
fix wrong symlink


Modified: trunk/examples/simple/scripts/FAIBASE/20-removable_media
===================================================================
--- trunk/examples/simple/scripts/FAIBASE/20-removable_media	2006-09-21 13:46:23 UTC (rev 3998)
+++ trunk/examples/simple/scripts/FAIBASE/20-removable_media	2006-09-21 13:49:41 UTC (rev 3999)
@@ -3,6 +3,8 @@
 # (c) Thomas Lange, 2006, lange at debian.org
 # create entries for removable media in fstab and directories in /media
 
+ainsl $target/etc/fstab "/dev/fd0  /floppy  auto  users,noauto 0 0"
+
 cdromlist() {
     [ -f /proc/sys/dev/cdrom/info ] || return
     devs=$(grep 'drive name:' /proc/sys/dev/cdrom/info | cut -d ":" -f 2)
@@ -12,16 +14,14 @@
 }
 
 fstabline () {
-    printf "%-15s %-15s %-7s %-15s %-7s %s\n" "$1" "$2" "$3" "$4" "$5" "$6" >> $target/etc/fstab
+    line=$(printf "%-15s %-15s %-7s %-15s %-7s %s\n" "$1" "$2" "$3" "$4" "$5" "$6")
+    ainsl $target/etc/fstab "$line"
 }
 
-
-[ -f $target/media/cdrom0 ] && return # make script idempotent
 i=0
 for cdrom in $(cdromlist | tac); do
     [ $i -eq 0 ] && ln -s cdrom0 $target/media/cdrom
-    echo "cdrom$i: $cdrom"
-    mkdir $target/media/cdrom$i
+    [ -d $target/media/cdrom$i ] || mkdir $target/media/cdrom$i
     fstabline /dev/$cdrom /media/cdrom$i udf,iso9660 ro,user,noauto 0 0
     i=$(($i + 1))
 done

Modified: trunk/examples/simple/scripts/FAIBASE/40-misc
===================================================================
--- trunk/examples/simple/scripts/FAIBASE/40-misc	2006-09-21 13:46:23 UTC (rev 3998)
+++ trunk/examples/simple/scripts/FAIBASE/40-misc	2006-09-21 13:49:41 UTC (rev 3999)
@@ -20,10 +20,6 @@
 	  ReplaceAll "^UTC=.*" With "UTC=${UTC}"
 	}
 
-	{ ${target}/etc/fstab
-	  AppendIfNoSuchLine "/dev/fd0  /floppy  auto  users,noauto 0 0"
-	}
-
 	{ ${target}/etc/hosts
 	  AppendIfNoSuchLine "127.0.0.1       localhost"
 	}




More information about the Fai-commit mailing list