functions-mountdisk.sh (232899) | functions-mountdisk.sh (240165) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# | 1#!/bin/sh 2#- 3# Copyright (c) 2010 iXsystems, Inc. All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions 7# are met: 8# 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24# SUCH DAMAGE. 25# |
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh 232899 2012-03-12 21:32:43Z jpaetzel $ | 26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh 240165 2012-09-06 14:59:53Z jpaetzel $ |
27 28# Functions related mounting the newly formatted disk partitions 29 30# Mounts all the specified partition to the mount-point 31mount_partition() 32{ 33 if [ -z "${1}" -o -z "${2}" -o -z "${3}" ] 34 then --- 41 unchanged lines hidden (view full) --- 76 echo "$ZOPT" | grep -q volsize 77 if [ $? -eq 0 ] ; then 78 volsize=`echo $ZOPT | cut -d '=' -f 2` 79 zcopt="-V $volsize" 80 fi 81 done 82 83 if [ "${ZMNT}" = "/" ] ; then | 27 28# Functions related mounting the newly formatted disk partitions 29 30# Mounts all the specified partition to the mount-point 31mount_partition() 32{ 33 if [ -z "${1}" -o -z "${2}" -o -z "${3}" ] 34 then --- 41 unchanged lines hidden (view full) --- 76 echo "$ZOPT" | grep -q volsize 77 if [ $? -eq 0 ] ; then 78 volsize=`echo $ZOPT | cut -d '=' -f 2` 79 zcopt="-V $volsize" 80 fi 81 done 82 83 if [ "${ZMNT}" = "/" ] ; then |
84 ZNAME="" | 84 # If creating ZFS / dataset, give it name that beadm works with 85 ZNAME="/ROOT/default" 86 ZMKMNT="" 87 echo_log "zfs create $zcopt -p ${ZPOOLNAME}/ROOT" 88 rc_halt "zfs create $zcopt -p ${ZPOOLNAME}/ROOT" 89 echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" 90 rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" |
85 else 86 ZNAME="${ZMNT}" | 91 else 92 ZNAME="${ZMNT}" |
93 ZMKMNT="${ZMNT}" |
|
87 echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" 88 rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" 89 fi 90 sleep 2 91 if [ -z "$zcopt" ] ; then | 94 echo_log "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" 95 rc_halt "zfs create $zcopt -p ${ZPOOLNAME}${ZNAME}" 96 fi 97 sleep 2 98 if [ -z "$zcopt" ] ; then |
92 rc_halt "zfs set mountpoint=${FSMNT}${ZNAME} ${ZPOOLNAME}${ZNAME}" | 99 rc_halt "zfs set mountpoint=${FSMNT}${ZMKMNT} ${ZPOOLNAME}${ZNAME}" |
93 fi 94 | 100 fi 101 |
102 # Do we need to make this / zfs dataset bootable? 103 if [ "$ZMNT" = "/" ] ; then 104 echo_log "Stamping ${ZPOOLNAME}/ROOT/default as bootfs" 105 rc_halt "zpool set bootfs=${ZPOOLNAME}/ROOT/default ${ZPOOLNAME}" 106 fi 107 108 # Do we need to make this /boot zfs dataset bootable? 109 if [ "$ZMNT" = "/boot" ] ; then 110 echo_log "Stamping ${ZPOOLNAME}${ZMNT} as bootfs" 111 rc_halt "zpool set bootfs=${ZPOOLNAME}${ZMNT} ${ZPOOLNAME}" 112 fi 113 |
|
95 # If no ZFS options, we can skip 96 if [ -z "$ZMNTOPTS" ] ; then continue ; fi 97 98 # Parse any ZFS options now 99 for ZOPT in `echo $ZMNTOPTS | sed 's/|/ /g'` 100 do 101 echo "$ZOPT" | grep -q volsize 102 if [ $? -eq 0 ] ; then continue ; fi --- 119 unchanged lines hidden --- | 114 # If no ZFS options, we can skip 115 if [ -z "$ZMNTOPTS" ] ; then continue ; fi 116 117 # Parse any ZFS options now 118 for ZOPT in `echo $ZMNTOPTS | sed 's/|/ /g'` 119 do 120 echo "$ZOPT" | grep -q volsize 121 if [ $? -eq 0 ] ; then continue ; fi --- 119 unchanged lines hidden --- |