[PC-BSD Commits] r1977 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Sat May 24 15:51:23 PDT 2008


Author: melkor
Date: 2008-05-24 15:51:23 -0700 (Sat, 24 May 2008)
New Revision: 1977

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountDisk.sh
Log:

Optimize MountDisk script


Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountDisk.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountDisk.sh	2008-05-24 22:11:23 UTC (rev 1976)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountDisk.sh	2008-05-24 22:51:23 UTC (rev 1977)
@@ -76,36 +76,23 @@
 ##
 # Check for any extra mount points and do it now
 ##
-if [ "${3}" ]
-then
-   mkdir -p ${FSMNT}${3}
-   echo "${ROOTPART}e${EXTENSION}          	${3}               ufs     rw${MNTOPTS}              1       1 
-" >> /tmp/fstab
-   mount -o rw${MNTOPTS} ${ROOTPART}e${EXTENSION} ${FSMNT}${3}
-fi
+part_d=${3}
+part_e=${4}
+part_f=${5}
+part_g=${6}
+part_h=${7}
 
-if [ "${4}" ]
-then
-   mkdir -p ${FSMNT}${4}
-   echo "${ROOTPART}f${EXTENSION}          	${4}               ufs     rw${MNTOPTS}              1       1 
+for lpart in `echo "d e f g h"`
+do
+  eval varname="part_${lpart}"
+  eval cur_part="\$${varname}"
+  if [ "${cur_part}" ]
+  then
+   mkdir -p ${FSMNT}${cur_part}
+   echo "${ROOTPART}${lpart}{EXTENSION}               ${cur_part}               ufs     rw${MNTOPTS}              1       1  
 " >> /tmp/fstab
-   mount -o rw${MNTOPTS} ${ROOTPART}f${EXTENSION} ${FSMNT}${4}
-fi
+   mount -o rw${MNTOPTS} ${ROOTPART}${lpart}{EXTENSION} ${FSMNT}${cur_part}
+  fi
+done
 
-if [ "${5}" ]
-then
-   mkdir -p ${FSMNT}${5}
-   echo "${ROOTPART}g${EXTENSION}          	${5}               ufs     rw${MNTOPTS}              1       1 
-" >> /tmp/fstab
-   mount -o rw${MNTOPTS} ${ROOTPART}g${EXTENSION} ${FSMNT}${5}
-fi
-
-if [ "${6}" ]
-then
-   mkdir -p ${FSMNT}${6}
-   echo "${ROOTPART}h${EXTENSION}          	${6}               ufs     rw${MNTOPTS}              1       1 
-" >> /tmp/fstab
-   mount -o rw${MNTOPTS} ${ROOTPART}h${EXTENSION} ${FSMNT}${6}
-fi
-
 cd /



More information about the Commits mailing list