Sets the following variables:
TEMP_BOOTCD_PATH where the boot cd is remounted in the temp
path
+ ROOT_MOUNTED set to 1 when the the base logical volumes
+ are mounted.
"""
log.write( "\n\nStep: Install: Bootstrapping RPM.\n" )
utils.sysexec( "mount -t ext3 %s %s/vservers" % (PARTITIONS["vservers"],
SYSIMG_PATH), log )
+ vars['ROOT_MOUNTED']= 1
+
+
# download and extract support tarball for
# this step, which has everything
# we need to successfully run
def Run( vars, log ):
"""
Unitializes hardware:
- - unmount all previously mounted partitions
+ - unmount everything mounted during install, except the
+ /dev/planetlab/root and /dev/planetlab/vservers. This includes
+ calling swapoff for /dev/planetlab/swap.
Except the following variables from the store:
TEMP_PATH the path to download and store temp files to
(always starts with TEMP_PATH)
PARTITIONS dictionary of generic part. types (root/swap)
and their associated devices.
- NODE_ID the node_id from the database for this node
-
- this is needed to make any requests back to the server
Sets the following variables:
None
if PARTITIONS == None:
raise ValueError, "PARTITIONS"
- NODE_ID= vars["NODE_ID"]
- if NODE_ID == "":
- raise ValueError("NODE_ID")
-
except KeyError, var:
raise BootManagerException, "Missing variable in vars: %s\n" % var
except ValueError, var:
log.write( "Unmounting proc.\n" )
utils.sysexec( "umount %s/proc" % SYSIMG_PATH, log )
- log.write( "Unmounting vserver partition.\n" )
- utils.sysexec( "umount %s" % PARTITIONS["vservers"], log )
-
log.write( "Unmounting rcfs file system in image.\n" )
utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log )
- log.write( "Unmounting system image.\n" )
- utils.sysexec( "umount %s" % PARTITIONS["root"], log )
-
log.write( "Shutting down swap\n" )
utils.sysexec( "swapoff %s" % PARTITIONS["swap"], log )
- # as one of the last steps, upload /var/log/messages if it exists
-
- # send a notification that the install is complete
- #action= "email"
- #message= "installfinished"
- #nodestate= ""
-
- #try:
- # result= utils.notifybootserver( BS_REQUEST, NODE_ID,
- # NODE_NONCE,
- # action, message, nodestate )
- #except AlpinaError, desc:
- # log.write( "Unable to notify boot server of " \
- # "install complete (not critical): %s" % desc )
-
return 1
if 'ROOT_MOUNTED' in vars.keys():
ROOT_MOUNTED= vars['ROOT_MOUNTED']
- # old cds need extra utilities to run lvm
- if BOOT_CD_VERSION[0] == 2:
- compatibility.setup_lvm_2x_cd( vars, log )
-
- # simply creating an instance of this class and listing the system
- # block devices will make them show up so vgscan can find the planetlab
- # volume group
- systeminfo().get_block_device_list()
-
# mount the root system image if we haven't already.
# capture BootManagerExceptions during the vgscan/change and mount
# calls, so we can return 0 instead
if ROOT_MOUNTED == 0:
+ # old cds need extra utilities to run lvm
+ if BOOT_CD_VERSION[0] == 2:
+ compatibility.setup_lvm_2x_cd( vars, log )
+
+ # simply creating an instance of this class and listing the system
+ # block devices will make them show up so vgscan can find the planetlab
+ # volume group
+ systeminfo().get_block_device_list()
+
try:
utils.sysexec( "vgscan", log )
utils.sysexec( "vgchange -ay planetlab", log )
log.write( "Node does not appear to be installed correctly:\n" )
log.write( "missing file /boot/ initrd-boot or kernel-boot\n" )
return 0
+
+ log.write( "Everything appears to be ok\n" )
return 1