summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
diff options
context:
space:
mode:
authorjpaetzel <jpaetzel@FreeBSD.org>2012-03-12 21:32:43 +0000
committerjpaetzel <jpaetzel@FreeBSD.org>2012-03-12 21:32:43 +0000
commit1f39c522b6640b045a8332fc5534be9cc2d52de7 (patch)
tree2b7fac050ef8e07d479321c26b2c517ec0fd4a4d /usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
parent67de24ef241ec77adb295b189d1d99e5b63ffafc (diff)
downloadFreeBSD-src-1f39c522b6640b045a8332fc5534be9cc2d52de7.zip
FreeBSD-src-1f39c522b6640b045a8332fc5534be9cc2d52de7.tar.gz
Add the ability to use a varity of ZFS dataset options.
While here fix a bug causing zpools with /tmp mount-points to fail Submitted by: kris Obtained from: PC-BSD
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-cleanup.sh')
-rwxr-xr-xusr.sbin/pc-sysinstall/backend/functions-cleanup.sh29
1 files changed, 16 insertions, 13 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh b/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
index d69135a..255dbc8 100755
--- a/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
+++ b/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
@@ -34,8 +34,8 @@ zfs_cleanup_unmount()
for PART in `ls ${PARTDIR}`
do
PARTDEV=`echo $PART | sed 's|-|/|g'`
- PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
- PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
+ PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`"
+ PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`"
ZPOOLNAME=$(get_zpool_name "${PARTDEV}")
if [ "$PARTFS" = "ZFS" ]
@@ -84,9 +84,9 @@ zfs_cleanup_unmount()
for PART in `ls ${PARTDIR}`
do
PARTDEV=`echo $PART | sed 's|-|/|g'`
- PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
- PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
- PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
+ PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`"
+ PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`"
+ PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`"
ZPOOLNAME=$(get_zpool_name "${PARTDEV}")
if [ "$PARTFS" = "ZFS" ]
@@ -101,17 +101,20 @@ zfs_cleanup_unmount()
# Check if we have multiple zfs mounts specified
for ZMNT in `echo ${PARTMNT} | sed 's|,| |g'`
do
+ ZMNT="`echo $ZMNT | cut -d '(' -f 1`"
PARTMNTREV="${ZMNT} ${PARTMNTREV}"
done
for ZMNT in ${PARTMNTREV}
do
- if [ "${ZMNT}" != "/" ]
- then
- rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}"
+ if [ "${ZMNT}" = "/" ] ; then continue ; fi
+ # Some ZFS like /swap aren't mounted, and dont need unmounting
+ mount | grep -q "${FSMNT}${ZMNT}"
+ if [ $? -eq 0 ] ; then
rc_halt "zfs unmount ${ZPOOLNAME}${ZMNT}"
- sleep 2
+ rc_halt "zfs set mountpoint=${ZMNT} ${ZPOOLNAME}${ZMNT}"
fi
+ sleep 2
done
fi
done
@@ -154,10 +157,10 @@ setup_fstab()
for PART in `ls ${PARTDIR}`
do
PARTDEV=`echo $PART | sed 's|-|/|g'`
- PARTFS="`cat ${PARTDIR}/${PART} | cut -d ':' -f 1`"
- PARTMNT="`cat ${PARTDIR}/${PART} | cut -d ':' -f 2`"
- PARTENC="`cat ${PARTDIR}/${PART} | cut -d ':' -f 3`"
- PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d ':' -f 4`"
+ PARTFS="`cat ${PARTDIR}/${PART} | cut -d '#' -f 1`"
+ PARTMNT="`cat ${PARTDIR}/${PART} | cut -d '#' -f 2`"
+ PARTENC="`cat ${PARTDIR}/${PART} | cut -d '#' -f 3`"
+ PARTLABEL="`cat ${PARTDIR}/${PART} | cut -d '#' -f 4`"
# Unset EXT
EXT=""
OpenPOWER on IntegriCloud