Deleted Added
full compact
parseconfig.sh (211730) parseconfig.sh (212337)
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/parseconfig.sh 211730 2010-08-24 06:11:46Z imp $
26# $FreeBSD: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh 212337 2010-09-08 20:10:24Z imp $
27
28# Main install configuration parsing script
29#
30
31# Source our functions scripts
32. ${BACKEND}/functions.sh
33. ${BACKEND}/functions-bsdlabel.sh
34. ${BACKEND}/functions-cleanup.sh

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

68
69# Start by doing a sanity check, which will catch any obvious mistakes in the config
70file_sanity_check "installMode disk0 installType installMedium packageType"
71
72# We passed the Sanity check, lets grab some of the universal config settings and store them
73check_value installMode "fresh upgrade"
74check_value bootManager "bsd none"
75check_value installType "PCBSD FreeBSD"
27
28# Main install configuration parsing script
29#
30
31# Source our functions scripts
32. ${BACKEND}/functions.sh
33. ${BACKEND}/functions-bsdlabel.sh
34. ${BACKEND}/functions-cleanup.sh

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

68
69# Start by doing a sanity check, which will catch any obvious mistakes in the config
70file_sanity_check "installMode disk0 installType installMedium packageType"
71
72# We passed the Sanity check, lets grab some of the universal config settings and store them
73check_value installMode "fresh upgrade"
74check_value bootManager "bsd none"
75check_value installType "PCBSD FreeBSD"
76check_value installMedium "dvd usb ftp rsync img"
76check_value installMedium "dvd usb ftp rsync"
77check_value packageType "uzip tar rsync split"
77check_value packageType "uzip tar rsync split"
78if_check_value_exists partition "all ALL s1 s2 s3 s4 free FREE"
78if_check_value_exists partition "all s1 s2 s3 s4 free image"
79if_check_value_exists mirrorbal "load prefer round-robin split"
80
81# We passed all sanity checks! Yay, lets start the install
82echo "File Sanity Check -> OK"
83
84# Lets load the various universal settings now
85get_value_from_cfg installMode
86INSTALLMODE="${VAL}" ; export INSTALLMODE

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

93
94get_value_from_cfg packageType
95PACKAGETYPE="${VAL}" ; export PACKAGETYPE
96
97# Check if we are doing any networking setup
98start_networking
99
100# If we are not doing an upgrade, lets go ahead and setup the disk
79if_check_value_exists mirrorbal "load prefer round-robin split"
80
81# We passed all sanity checks! Yay, lets start the install
82echo "File Sanity Check -> OK"
83
84# Lets load the various universal settings now
85get_value_from_cfg installMode
86INSTALLMODE="${VAL}" ; export INSTALLMODE

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

93
94get_value_from_cfg packageType
95PACKAGETYPE="${VAL}" ; export PACKAGETYPE
96
97# Check if we are doing any networking setup
98start_networking
99
100# If we are not doing an upgrade, lets go ahead and setup the disk
101if [ "${INSTALLMODE}" = "fresh" ]
102then
101case "${INSTALLMODE}" in
102 fresh)
103 install_fresh
104 ;;
103
105
104 # Lets start setting up the disk slices now
105 setup_disk_slice
106
107 # Disk setup complete, now lets parse WORKINGSLICES and setup the bsdlabels
108 setup_disk_label
109
110 # Now we've setup the bsdlabels, lets go ahead and run newfs / zfs
111 # to setup the filesystems
112 setup_filesystems
106 upgrade)
107 install_upgrade
108 ;;
113
109
114 # Lets mount the partitions now
115 mount_all_filesystems
110 *)
111 exit 1
112 ;;
113esac
116
114
117 # We are ready to begin extraction, lets start now
118 init_extraction
119
120 # Check if we have any optional modules to load
121 install_components
122
123 # Check if we have any packages to install
124 install_packages
125
126 # Do any localization in configuration
127 run_localize
128
129 # Save any networking config on the installed system
130 save_networking_install
131
132 # Now add any users
133 setup_users
134
135 # Now run any commands specified
136 run_commands
137
138 # Do any last cleanup / setup before unmounting
139 run_final_cleanup
140
141 # Unmount and finish up
142 unmount_all_filesystems
143
144 echo_log "Installation finished!"
145 exit 0
146
147else
148 # We're going to do an upgrade, skip all the disk setup
149 # and start by mounting the target drive/slices
150 mount_upgrade
151
152 # Start the extraction process
153 init_extraction
154
155 # Do any localization in configuration
156 run_localize
157
158 # Now run any commands specified
159 run_commands
160
161 # Merge any old configuration files
162 merge_old_configs
163
164 # Check if we have any optional modules to load
165 install_components
166
167 # Check if we have any packages to install
168 install_packages
169
170 # All finished, unmount the file-systems
171 unmount_upgrade
172
173 echo_log "Upgrade finished!"
174 exit 0
175fi
176
115exit 0