Deleted Added
full compact
functions-newfs.sh (234990) functions-newfs.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-newfs.sh 234990 2012-05-03 21:53:25Z jpaetzel $
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh 240165 2012-09-06 14:59:53Z jpaetzel $
27
28# Functions related to disk operations using newfs
29
30
31# Function which performs the ZFS magic
32setup_zfs_filesystem()
33{
34 PART="$1"

--- 32 unchanged lines hidden (view full) ---

67 else
68 # No zpool options, create pool on single device
69 rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}"
70 fi
71
72 # Disable atime for this zfs partition, speed increase
73 rc_nohalt "zfs set atime=off ${ZPOOLNAME}"
74
27
28# Functions related to disk operations using newfs
29
30
31# Function which performs the ZFS magic
32setup_zfs_filesystem()
33{
34 PART="$1"

--- 32 unchanged lines hidden (view full) ---

67 else
68 # No zpool options, create pool on single device
69 rc_halt "zpool create -m none -f ${ZPOOLNAME} ${PART}${EXT}"
70 fi
71
72 # Disable atime for this zfs partition, speed increase
73 rc_nohalt "zfs set atime=off ${ZPOOLNAME}"
74
75 # Check if we need to set a bootable zpool
76 for i in `echo ${PARTMNT} | sed 's|,| |g'`
77 do
78 if [ "${i}" = "/" -o "${i}" = "/boot" ] ; then
79 if [ "$HAVEBOOT" = "YES" ] ; then continue ; fi
80 echo_log "Stamping zpool as bootfs"
81 rc_halt "zpool set bootfs=${ZPOOLNAME} ${ZPOOLNAME}"
82 fi
83 done
84
85};
86
87# Runs newfs on all the partiions which we've setup with bsdlabel
88setup_filesystems()
89{
90
91 # Create the keydir
92 rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null

--- 46 unchanged lines hidden (view full) ---

139 # No Encryption
140 EXT=""
141 fi
142
143 case ${PARTFS} in
144 UFS)
145 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
146 sleep 2
75};
76
77# Runs newfs on all the partiions which we've setup with bsdlabel
78setup_filesystems()
79{
80
81 # Create the keydir
82 rm -rf ${GELIKEYDIR} >/dev/null 2>/dev/null

--- 46 unchanged lines hidden (view full) ---

129 # No Encryption
130 EXT=""
131 fi
132
133 case ${PARTFS} in
134 UFS)
135 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
136 sleep 2
147 rc_halt "newfs ${PARTXTRAOPTS} ${PARTDEV}${EXT}"
137 rc_halt "newfs -t ${PARTXTRAOPTS} ${PARTDEV}${EXT}"
148 sleep 2
149 rc_halt "sync"
150 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
151 rc_halt "sync"
152
153 # Set flag that we've found a boot partition
154 if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
155 HAVEBOOT="YES"
156 fi
157 sleep 2
158 ;;
159
160 UFS+S)
161 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
162 sleep 2
138 sleep 2
139 rc_halt "sync"
140 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
141 rc_halt "sync"
142
143 # Set flag that we've found a boot partition
144 if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
145 HAVEBOOT="YES"
146 fi
147 sleep 2
148 ;;
149
150 UFS+S)
151 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
152 sleep 2
163 rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}"
153 rc_halt "newfs -t ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}"
164 sleep 2
165 rc_halt "sync"
166 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
167 rc_halt "sync"
168 # Set flag that we've found a boot partition
169 if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
170 HAVEBOOT="YES"
171 fi
172 sleep 2
173 ;;
174
175 UFS+SUJ)
176 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
177 sleep 2
154 sleep 2
155 rc_halt "sync"
156 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
157 rc_halt "sync"
158 # Set flag that we've found a boot partition
159 if [ "$PARTMNT" = "/boot" -o "${PARTMNT}" = "/" ] ; then
160 HAVEBOOT="YES"
161 fi
162 sleep 2
163 ;;
164
165 UFS+SUJ)
166 echo_log "NEWFS: ${PARTDEV} - ${PARTFS}"
167 sleep 2
178 rc_halt "newfs ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}"
168 rc_halt "newfs -t ${PARTXTRAOPTS} -U ${PARTDEV}${EXT}"
179 sleep 2
180 rc_halt "sync"
181 rc_halt "tunefs -j enable ${PARTDEV}${EXT}"
182 sleep 2
183 rc_halt "sync"
184 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
185 rc_halt "sync"
186 # Set flag that we've found a boot partition

--- 48 unchanged lines hidden ---
169 sleep 2
170 rc_halt "sync"
171 rc_halt "tunefs -j enable ${PARTDEV}${EXT}"
172 sleep 2
173 rc_halt "sync"
174 rc_halt "glabel label ${PARTLABEL} ${PARTDEV}${EXT}"
175 rc_halt "sync"
176 # Set flag that we've found a boot partition

--- 48 unchanged lines hidden ---