From: Heiko Z. <smi...@us...> - 2009-12-12 14:42:06
|
Update of /cvsroot/devil-linux/build/config/etc/init.d In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv31244/config/etc/init.d Modified Files: mountfs Log Message: - closed bug #38 - pre_init and mountfs: messing up /var mountfs now always creates missing files and folders after mounting a logical volume (not overwriting anything existing) Index: mountfs =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/mountfs,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- mountfs 11 Sep 2009 02:49:42 -0000 1.46 +++ mountfs 12 Dec 2009 14:41:58 -0000 1.47 @@ -28,6 +28,9 @@ LVMSYS="devil-linux" LVM="1" +# var-archive +VAR_ARCHIVE=/config/var.tar.bz2 + lvm_scan () { local do_display=$1 @@ -74,6 +77,8 @@ modprobe quota_v2 > /dev/null quotaon $LD fi + echo "Creating missing files and folders" + tar --no-overwrite-dir --keep-old-files --keep-newer-files -C / -xjf $VAR_ARCHIVE ${LD#/} 2> /dev/null else echo "ERROR: cannot create directory: $LD, $LV not mounted" fi @@ -132,7 +137,7 @@ # if we found the devil-linux vg mount the filesystems if [ -d /dev/$LVMSYS ]; then echo "Devil-Linux Harddisk found, activating..." - + echo "... mounting LVM partitions defined in $LVMTAB" while read LV LD LT LO L1 L2 LX; do [ $(echo ${LV:-#} | cut -c1) = "#" ] && continue [ ! -e /dev/$LVMSYS/$LV ] && continue @@ -140,6 +145,7 @@ lvm_mount done < $LVMTAB + echo "... mounting LVM partitions not defined in $LVMTAB" for lv in $(ls /dev/$LVMSYS); do test "$lv" = "group" && continue if [ $(expand $LVMTAB | grep -c "^$lv ") -eq 1 ]; then |