| … | |
… | |
| 61 | # where each entry is a function (with no arguments) that carries out the desired actions. |
61 | # where each entry is a function (with no arguments) that carries out the desired actions. |
| 62 | # Of course, steps will be different depending on the install_profile |
62 | # Of course, steps will be different depending on the install_profile |
| 63 | |
63 | |
| 64 | self._architecture_name = "generic" |
64 | self._architecture_name = "generic" |
| 65 | self._install_steps = { |
65 | self._install_steps = { |
|
|
66 | 'do_recommended_partitioning' : "Automatically partition the drive", |
| 66 | 'mount_local_partitions': "Mount local partitions", |
67 | 'mount_local_partitions': "Mount local partitions", |
| 67 | 'mount_network_shares': "Mount network (NFS) shares", |
68 | 'mount_network_shares': "Mount network (NFS) shares", |
| 68 | 'unpack_stage_tarball': "Unpack stage tarball", |
69 | 'unpack_stage_tarball': "Unpack stage tarball", |
| 69 | 'update_config_files': "Updating config files", |
70 | 'update_config_files': "Updating config files", |
| 70 | 'configure_make_conf': "Configure /etc/make.conf", |
71 | 'configure_make_conf': "Configure /etc/make.conf", |
| … | |
… | |
| 260 | self._logger.log("fstab configured.") |
261 | self._logger.log("fstab configured.") |
| 261 | |
262 | |
| 262 | ##################################################################### |
263 | ##################################################################### |
| 263 | ##################################################################### |
264 | ##################################################################### |
| 264 | ########################## Installation Functions ################### |
265 | ########################## Installation Functions ################### |
|
|
266 | |
|
|
267 | ## |
|
|
268 | # Will automatically partition the hard drive if both paramaters |
|
|
269 | # in the install_profile are correctly set. This in turn will |
|
|
270 | # appropriately set the mountpoints for the rest of the install. |
|
|
271 | # This function is to be called only for fully-automated installs. |
|
|
272 | def do_recommended_partitioning(self): |
|
|
273 | drive = self._install_profile.get_do_recommended_partitioning() #returns drive name. |
|
|
274 | second_check = self._install_profile.get_yes_iam_sure() |
|
|
275 | if drive and second_check: |
|
|
276 | try: |
|
|
277 | self._logger.log("Creating the drive object for drive %s for do_recommended" % drive) |
|
|
278 | driveobject = Partitioning.Device(drive, self._architecture_name, self._install_profile) |
|
|
279 | self._logger.log("Running do_recommended!") |
|
|
280 | driveobject.do_recommended() |
|
|
281 | self._logger.log("do_recommended complete! mountpoints should now be set.") |
|
|
282 | except: |
|
|
283 | raise GLIException("DoRecommendedError", 'fatal','do_recommended_partitioning', "An Error occurred while trying to run do_recommended!") |
|
|
284 | |
|
|
285 | |
| 265 | ## |
286 | ## |
| 266 | # Will grab partition info from the profile and mount all partitions with a specified mountpoint (and swap too) |
287 | # Will grab partition info from the profile and mount all partitions with a specified mountpoint (and swap too) |
| 267 | def mount_local_partitions(self): |
288 | def mount_local_partitions(self): |
| 268 | #Temporary hack here to update the debug value. |
289 | #Temporary hack here to update the debug value. |
| 269 | self._debug = self._install_profile.get_verbose() |
290 | self._debug = self._install_profile.get_verbose() |
| … | |
… | |
| 1297 | shutil.copy(install_logfile, self._chroot_dir + install_logfile) |
1318 | shutil.copy(install_logfile, self._chroot_dir + install_logfile) |
| 1298 | except: |
1319 | except: |
| 1299 | if self._debug: self._logger.log("DEBUG: finishing_cleanup(): ERROR! could not copy logfile over to /root.") |
1320 | if self._debug: self._logger.log("DEBUG: finishing_cleanup(): ERROR! could not copy logfile over to /root.") |
| 1300 | #Now we're done logging as far as the new system is concerned. |
1321 | #Now we're done logging as far as the new system is concerned. |
| 1301 | GLIUtility.spawn("cp /tmp/installprofile.xml " + self._chroot_dir + "/root/installprofile.xml") |
1322 | GLIUtility.spawn("cp /tmp/installprofile.xml " + self._chroot_dir + "/root/installprofile.xml") |
| 1302 | GLIUtility.spawn("cp /tmp/clientconfiguration.xml " + self._chroot_dir + "/root/clientconfiguration.xml") |
1323 | |
| 1303 | |
1324 | |
| 1304 | #Unmount mounted fileystems in preparation for reboot |
1325 | #Unmount mounted fileystems in preparation for reboot |
| 1305 | #mounts = GLIUtility.spawn(r"mount | sed -e 's:^.\+ on \(.\+\) type .\+$:\1:' | grep -e '^" + self._chroot_dir + "' | sort -r", return_output=True)[1].split("\n") |
1326 | #mounts = GLIUtility.spawn(r"mount | sed -e 's:^.\+ on \(.\+\) type .\+$:\1:' | grep -e '^" + self._chroot_dir + "' | sort -r", return_output=True)[1].split("\n") |
| 1306 | if self._debug: self._logger.log("DEBUG: mounted_devices is %s" % str(self._mounted_devices)) |
1327 | if self._debug: self._logger.log("DEBUG: mounted_devices is %s" % str(self._mounted_devices)) |
| 1307 | mounted_devices = self._mounted_devices |
1328 | mounted_devices = self._mounted_devices |