diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2011-04-21 06:25:12 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2011-04-21 06:25:12 +0000 |
commit | 582666352393e5b7a5a00ec55b4c3f44dbedc556 (patch) | |
tree | 1928c68175bbb582e55c99428e2b88df779b80e9 /usr.sbin/pc-sysinstall/backend/functions-unmount.sh | |
parent | b6d230d6e1d79f2d8c4821ca274b3ac4ee7cc1eb (diff) | |
download | FreeBSD-src-582666352393e5b7a5a00ec55b4c3f44dbedc556.zip FreeBSD-src-582666352393e5b7a5a00ec55b4c3f44dbedc556.tar.gz |
- Allows using full device name paths, such as /dev/ad0 or /dev/mirror/gm0 in config files
- Fixes some issues creating gmirror devices, including on GPT partitions
- Bugfixes for ZFS mirroring
- Enhanced GELI to work with a passphrase only, or key-file only
- Bugfix to prevent crashing of PC-BSD Live media when checking for upgrade partitions
Submitted by: Kris Moore <kmoore@freebsd.org>
Approved by: kib (mentor)
Sponsored by: iXsystems
Diffstat (limited to 'usr.sbin/pc-sysinstall/backend/functions-unmount.sh')
-rwxr-xr-x | usr.sbin/pc-sysinstall/backend/functions-unmount.sh | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/usr.sbin/pc-sysinstall/backend/functions-unmount.sh b/usr.sbin/pc-sysinstall/backend/functions-unmount.sh index 5e80985..ce0db9b 100755 --- a/usr.sbin/pc-sysinstall/backend/functions-unmount.sh +++ b/usr.sbin/pc-sysinstall/backend/functions-unmount.sh @@ -42,7 +42,7 @@ umount_all_dir() start_gmirror_sync() { - cd ${MIRRORCFGDIR} + cd ${MIRRORCFGDIR} for DISK in `ls *` do MIRRORDISK="`cat ${DISK} | cut -d ':' -f 1`" @@ -50,6 +50,7 @@ start_gmirror_sync() MIRRORNAME="`cat ${DISK} | cut -d ':' -f 3`" # Start the mirroring service + rc_nohalt "gmirror forget ${MIRRORNAME}" rc_halt "gmirror insert ${MIRRORNAME} /dev/${MIRRORDISK}" done @@ -70,7 +71,7 @@ unmount_all_filesystems() ################################################################## 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`" @@ -83,24 +84,24 @@ unmount_all_filesystems() EXT="" fi - #if [ "${PARTFS}" = "SWAP" ] - #then - # rc_nohalt "swapoff /dev/${PART}${EXT}" - #fi + if [ "${PARTFS}" = "SWAP" ] + then + rc_nohalt "swapoff ${PARTDEV}${EXT}" + fi # Check if we've found "/", and unmount that last if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] then - rc_halt "umount -f /dev/${PART}${EXT}" + rc_halt "umount -f ${PARTDEV}${EXT}" # Re-check if we are missing a label for this device and create it again if so if [ ! -e "/dev/label/${PARTLABEL}" ] then case ${PARTFS} in - UFS) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; - UFS+S) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; - UFS+SUJ) glabel label ${PARTLABEL} /dev/${PART}${EXT} ;; - UFS+J) glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal ;; + UFS) glabel label ${PARTLABEL} ${PARTDEV}${EXT} ;; + UFS+S) glabel label ${PARTLABEL} ${PARTDEV}${EXT} ;; + UFS+SUJ) glabel label ${PARTLABEL} ${PARTDEV}${EXT} ;; + UFS+J) glabel label ${PARTLABEL} ${PARTDEV}${EXT}.journal ;; *) ;; esac fi @@ -112,10 +113,10 @@ unmount_all_filesystems() if [ ! -e "/dev/label/${PARTLABEL}" ] then case ${PARTFS} in - UFS) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; - UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; - UFS+SUJ) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}" ;; - UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} /dev/${PART}${EXT}.journal" ;; + UFS) ROOTRELABEL="glabel label ${PARTLABEL} ${PARTDEV}${EXT}" ;; + UFS+S) ROOTRELABEL="glabel label ${PARTLABEL} ${PARTDEV}${EXT}" ;; + UFS+SUJ) ROOTRELABEL="glabel label ${PARTLABEL} ${PARTDEV}${EXT}" ;; + UFS+J) ROOTRELABEL="glabel label ${PARTLABEL} ${PARTDEV}${EXT}.journal" ;; *) ;; esac fi @@ -166,25 +167,25 @@ unmount_all_filesystems_failure() then 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`" - #if [ "${PARTFS}" = "SWAP" ] - #then - # if [ "${PARTENC}" = "ON" ] - # then - # rc_nohalt "swapoff /dev/${PART}.eli" - # else - # rc_nohalt "swapoff /dev/${PART}" - # fi - #fi + if [ "${PARTFS}" = "SWAP" ] + then + if [ "${PARTENC}" = "ON" ] + then + rc_nohalt "swapoff ${PARTDEV}.eli" + else + rc_nohalt "swapoff ${PARTDEV}" + fi + fi # Check if we've found "/" again, don't need to mount it twice if [ "$PARTMNT" != "/" -a "${PARTMNT}" != "none" -a "${PARTFS}" != "ZFS" ] then - rc_nohalt "umount -f /dev/${PART}" + rc_nohalt "umount -f ${PARTDEV}" rc_nohalt "umount -f ${FSMNT}${PARTMNT}" fi done |