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

svn at pcbsd.org svn at pcbsd.org
Wed May 21 11:56:28 PDT 2008


Author: kris
Date: 2008-05-21 11:56:28 -0700 (Wed, 21 May 2008)
New Revision: 1943

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

Made changes to the scripts to support UFS2 UFS+Softupdates and UFS+Journaling
will add ZFS support soon



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-21 18:38:09 UTC (rev 1942)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.MountDisk.sh	2008-05-21 18:56:28 UTC (rev 1943)
@@ -9,9 +9,26 @@
   ROOTPART="${1}"
 fi
 
+# Check which filesystem type we are using
+case ${2} in
+  0) FS="UFS2" ;;
+  1) FS="UFS-S" ;;
+  2) FS="UFS-J" ;;
+  3) FS="ZFS" ;;
+  *) FS="UFS-J" ;;
+esac
+
+if [ "$FS" = "UFS-J" ]
+then
+  EXTENSION=".journal"
+else
+  EXTENSION=""
+fi
+
+
 echo "Creating fstab file";
 
-mount ${ROOTPART}a /mnt >/dev/null 2>/dev/null
+mount ${ROOTPART}a${EXTENSION} /mnt >/dev/null 2>/dev/null
 
 if [ -e "/tmp/mirrorDrive" ]
 then
@@ -45,53 +62,45 @@
   ENC=""
 fi
 
-#mkdir -p /mnt/PCBSD/Computer/Drives
 
-# Create the PC-BSD Disk Icon
-#echo "[Desktop Entry]
-#Dev=${ROOTPART}a
-#Encoding=UTF-8
-#Icon=hdd_mount
-#MountPoint=/
-#ReadOnly=false
-#Type=FSDevice
-#UnmountIcon=hdd_unmount" >/mnt/PCBSD/Computer/Drives/PC-BSD
-
 # Create the FSTAB file
 echo "# Device                Mountpoint      FStype  Options         Dump    Pass#
 ${ROOTPART}b${ENC}          	none            swap    sw              0       0
-${ROOTPART}a          	/               ufs     rw              1       1 " > /tmp/fstab
+${ROOTPART}a${EXTENSION}          	/               ufs     rw              1       1 " > /tmp/fstab
 
-if [ "${2}" ]
+##
+# Check for any extra mount points and do it now
+##
+if [ "${3}" ]
 then
    mkdir -p /mnt${2}
-   echo "${ROOTPART}e          	${2}               ufs     rw              1       1 
+   echo "${ROOTPART}e${EXTENSION}          	${3}               ufs     rw              1       1 
 " >> /tmp/fstab
-   mount ${ROOTPART}e /mnt${2}
+   mount ${ROOTPART}e${EXTENSION} /mnt${3}
 fi
 
-if [ "${3}" ]
-then
-   mkdir -p /mnt${3}
-   echo "${ROOTPART}f          	${3}               ufs     rw              1       1 
-" >> /tmp/fstab
-   mount ${ROOTPART}f /mnt${3}
-fi
-
 if [ "${4}" ]
 then
    mkdir -p /mnt${4}
-   echo "${ROOTPART}g          	${4}               ufs     rw              1       1 
+   echo "${ROOTPART}f${EXTENSION}          	${4}               ufs     rw              1       1 
 " >> /tmp/fstab
-   mount ${ROOTPART}g /mnt${4}
+   mount ${ROOTPART}f${EXTENSION} /mnt${4}
 fi
 
 if [ "${5}" ]
 then
    mkdir -p /mnt${5}
-   echo "${ROOTPART}h          	${5}               ufs     rw              1       1 
+   echo "${ROOTPART}g${EXTENSION}          	${5}               ufs     rw              1       1 
 " >> /tmp/fstab
-   mount ${ROOTPART}h /mnt${5}
+   mount ${ROOTPART}g${EXTENSION} /mnt${5}
 fi
 
+if [ "${6}" ]
+then
+   mkdir -p /mnt${6}
+   echo "${ROOTPART}h${EXTENSION}          	${6}               ufs     rw              1       1 
+" >> /tmp/fstab
+   mount ${ROOTPART}h${EXTENSION} /mnt${6}
+fi
+
 cd /

Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NewFS.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NewFS.sh	2008-05-21 18:38:09 UTC (rev 1942)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.NewFS.sh	2008-05-21 18:56:28 UTC (rev 1943)
@@ -1,5 +1,15 @@
 #!/bin/sh
+##########################################################################
 
+# Check which filesystem type we are using
+case ${2} in
+  0) FS="UFS2" ;;
+  1) FS="UFS-S" ;;
+  2) FS="UFS-J" ;;
+  3) FS="ZFS" ;;
+  *) FS="UFS-J" ;;
+esac
+
 #echo "Activating swap space..."
 #dd if=/dev/zero of=/mnt/swap0 bs=1024k count=256 >/dev/null 2>/dev/null
 #chmod 0600 /mnt/swap0 >/dev/null 2>/dev/null
@@ -7,9 +17,43 @@
 
 swapon ${1}b
 
-for DevName in `ls -1 ${1}[a,d-h]`
-do
-  echo "Running Newfs on ${DevName}"
-  newfs -U ${DevName} >/dev/null 2>/dev/null
-done
+if [ "${FS}" = "UFS-J" ]
+then
+  for DevName in `ls -1 ${1}[a,d-h]`
+  do
+    echo "Running Newfs on ${DevName}"
+    gjournal label -f ${DevName}
+    newfs -O 2 -J ${DevName}.journal >/dev/null 2>/dev/null
+  done
+  exit 0
+fi
 
+if [ "${FS}" = "ZFS" ]
+then
+
+  exit 0
+fi
+
+
+
+# UFS with Soft Updates
+if [ "${FS} = "UFS-S" ]
+then
+  for DevName in `ls -1 ${1}[a,d-h]`
+  do
+    echo "Running Newfs on ${DevName}"
+    newfs -U ${DevName} >/dev/null 2>/dev/null
+  done
+ exit 0
+fi
+
+# UFS2 Vanilla
+if [ "${FS} = "UFS2" ]
+then
+  for DevName in `ls -1 ${1}[a,d-h]`
+  do
+    echo "Running Newfs on ${DevName}"
+    newfs ${DevName} >/dev/null 2>/dev/null
+  done
+ exit 0
+fi



More information about the Commits mailing list