From: Mark Huang Date: Mon, 21 Aug 2006 21:21:12 +0000 (+0000) Subject: merge to HEAD as of 2006-08-21 X-Git-Tag: myplc-0_4-rc3~3 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=77245192b952dbce59e26003d2290287c6b15878 merge to HEAD as of 2006-08-21 --- diff --git a/bootmanager.spec b/bootmanager.spec index 9620ae5..8794128 100644 --- a/bootmanager.spec +++ b/bootmanager.spec @@ -47,8 +47,6 @@ find build.sh source | cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/ install -D -m 755 bootmanager.sh $RPM_BUILD_ROOT/var/www/html/boot/bootmanager.sh for file in \ uudecode.gz \ - alpina-BootLVM.tar.gz \ - alpina-PartDisks.tar.gz \ PlanetLab-Bootstrap.tar.bz2 ; do install -D -m 644 support-files/$file $RPM_BUILD_ROOT/var/www/html/boot/$file done diff --git a/source/BootAPI.py b/source/BootAPI.py index f1d418b..a27593b 100644 --- a/source/BootAPI.py +++ b/source/BootAPI.py @@ -1,3 +1,12 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + import xmlrpclib import xml.parsers.expat import hmac diff --git a/source/BootManager.py b/source/BootManager.py index 5519af4..76b42e5 100755 --- a/source/BootManager.py +++ b/source/BootManager.py @@ -1,52 +1,10 @@ #!/usr/bin/python2 -u -# ------------------------------------------------------------------------ -# THIS file used to be named alpina.py, from the node installer. Since then -# the installer has been expanded to include all the functions of the boot -# manager as well, hence the new name for this file. -# ------------------------------------------------------------------------ - # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. import string import sys, os, traceback @@ -58,8 +16,6 @@ from Exceptions import * import notify_messages import BootServerRequest - - # all output is written to this file LOG_FILE= "/tmp/bm.log" UPLOAD_LOG_PATH = "/alpina-logs/upload.php" @@ -147,43 +103,19 @@ class BootManager: # override machine's current state from the command line self.forceState = forceState - # this contains a set of information used and updated - # by each step - self.VARS= {} - # the main logging point self.LOG= log # set to 1 if we can run after initialization self.CAN_RUN = 0 - if not self.ReadBMConf(): - self.LOG.LogEntry( "Unable to read configuration vars." ) - return - - # find out which directory we are running it, and set a variable - # for that. future steps may need to get files out of the bootmanager - # directory - current_dir= os.getcwd() - self.VARS['BM_SOURCE_DIR']= current_dir - - # not sure what the current PATH is set to, replace it with what - # we know will work with all the boot cds - os.environ['PATH']= string.join(BIN_PATH,":") - - self.CAN_RUN= 1 - - def ReadBMConf(self): - """ - read in and store all variables in VARS_FILE into - self.VARS - - each line is in the format name=val (any whitespace around - the = is removed. everything after the = to the end of - the line is the value - """ - + # read in and store all variables in VARS_FILE into each line + # is in the format name=val (any whitespace around the = is + # removed. everything after the = to the end of the line is + # the value + vars = {} vars_file= file(self.VARS_FILE,'r') + validConfFile = True for line in vars_file: # if its a comment or a whitespace line, ignore if line[:1] == "#" or string.strip(line) == "": @@ -192,15 +124,34 @@ class BootManager: parts= string.split(line,"=") if len(parts) != 2: self.LOG.LogEntry( "Invalid line in vars file: %s" % line ) - return 0 + validConfFile = False + break name= string.strip(parts[0]) value= string.strip(parts[1]) + vars[name]= value - self.VARS[name]= value + vars_file.close() + if not validConfFile: + self.LOG.LogEntry( "Unable to read configuration vars." ) + return + + # find out which directory we are running it, and set a variable + # for that. future steps may need to get files out of the bootmanager + # directory + current_dir= os.getcwd() + vars['BM_SOURCE_DIR']= current_dir + + # not sure what the current PATH is set to, replace it with what + # we know will work with all the boot cds + os.environ['PATH']= string.join(BIN_PATH,":") + + # this contains a set of information used and updated + # by each step + self.VARS= vars + + self.CAN_RUN= 1 - return 1 - def Run(self): """ core boot manager logic. @@ -228,7 +179,26 @@ class BootManager: self.VARS['STATE_CHANGE_NOTIFY']= 1 self.VARS['STATE_CHANGE_NOTIFY_MESSAGE']= \ notify_messages.MSG_NODE_NOT_INSTALLED - UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) + raise BootManagerException, \ + notify_messages.MSG_NODE_NOT_INSTALLED + + def _bootRun(): + # implements the boot logic, which consists of first + # double checking that the node was properly installed, + # checking whether someone added or changed disks, and + # then finally chain boots. + + InstallInit.Run( self.VARS, self.LOG ) + if ValidateNodeInstall.Run( self.VARS, self.LOG ): + WriteModprobeConfig.Run( self.VARS, self.LOG ) + WriteNetworkConfig.Run( self.VARS, self.LOG ) + # the following step should be done by NM + UpdateNodeConfiguration.Run( self.VARS, self.LOG ) + CheckForNewDisks.Run( self.VARS, self.LOG ) + SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) + ChainBootNode.Run( self.VARS, self.LOG ) + else: + _nodeNotInstalled() def _rinsRun(): # implements the reinstall logic, which will check whether @@ -237,17 +207,23 @@ class BootManager: # 'boot' state and chainboot into the production system if not CheckHardwareRequirements.Run( self.VARS, self.LOG ): self.VARS['BOOT_STATE']= 'dbg' - UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) raise BootManagerException, "Hardware requirements not met." - self.RunInstaller() - - if ValidateNodeInstall.Run( self.VARS, self.LOG ): - SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) - ChainBootNode.Run( self.VARS, self.LOG ) - else: - _nodeNotInstalled() - + # runinstaller + InstallInit.Run( self.VARS, self.LOG ) + InstallPartitionDisks.Run( self.VARS, self.LOG ) + InstallBootstrapRPM.Run( self.VARS, self.LOG ) + InstallWriteConfig.Run( self.VARS, self.LOG ) + InstallBuildVServer.Run( self.VARS, self.LOG ) + InstallNodeInit.Run( self.VARS, self.LOG ) + InstallUninitHardware.Run( self.VARS, self.LOG ) + self.VARS['BOOT_STATE']= 'boot' + self.VARS['STATE_CHANGE_NOTIFY']= 1 + self.VARS['STATE_CHANGE_NOTIFY_MESSAGE']= \ + notify_messages.MSG_INSTALL_FINISHED + UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) + _bootRun() + def _newRun(): # implements the new install logic, which will first check # with the user whether it is ok to install on this @@ -260,32 +236,17 @@ class BootManager: UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) _rinsRun() - def _bootRun(): - # implements the boot logic, which consists of first - # double checking that the node was properly installed, - # checking whether someone added or changed disks, and - # then finally chain boots. - - if ValidateNodeInstall.Run( self.VARS, self.LOG ): - UpdateNodeConfiguration.Run( self.VARS, self.LOG ) - CheckForNewDisks.Run( self.VARS, self.LOG ) - SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) - ChainBootNode.Run( self.VARS, self.LOG ) - else: - _nodeNotInstalled() - - def _debugRun(): # implements debug logic, which just starts the sshd # and just waits around + self.VARS['BOOT_STATE']='dbg' + UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) StartDebug.Run( self.VARS, self.LOG ) def _badRun(): # should never happen; log event self.LOG.write( "\nInvalid BOOT_STATE = %s\n" % self.VARS['BOOT_STATE']) - self.VARS['BOOT_STATE']= 'dbg' - UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) - StartDebug.Run( self.VARS, self.LOG ) + _debugRun() global NodeRunStates # setup state -> function hash table @@ -295,6 +256,7 @@ class BootManager: NodeRunStates['boot'] = _bootRun NodeRunStates['dbg'] = _debugRun + success = 0 try: InitializeBootManager.Run( self.VARS, self.LOG ) ReadNodeConfiguration.Run( self.VARS, self.LOG ) @@ -308,40 +270,30 @@ class BootManager: stateRun = NodeRunStates.get(self.VARS['BOOT_STATE'],_badRun) stateRun() + success = 1 except KeyError, e: self.LOG.write( "\n\nKeyError while running: %s\n" % str(e) ) except BootManagerException, e: self.LOG.write( "\n\nException while running: %s\n" % str(e) ) - - return 1 - - - - def RunInstaller(self): - """ - since the installer can be invoked at more than one place - in the boot manager logic, seperate the steps necessary - to do it here - """ - - InstallInit.Run( self.VARS, self.LOG ) - InstallPartitionDisks.Run( self.VARS, self.LOG ) - InstallBootstrapRPM.Run( self.VARS, self.LOG ) - InstallWriteConfig.Run( self.VARS, self.LOG ) - InstallBuildVServer.Run( self.VARS, self.LOG ) - InstallNodeInit.Run( self.VARS, self.LOG ) - InstallUninitHardware.Run( self.VARS, self.LOG ) - - self.VARS['BOOT_STATE']= 'boot' - self.VARS['STATE_CHANGE_NOTIFY']= 1 - self.VARS['STATE_CHANGE_NOTIFY_MESSAGE']= \ - notify_messages.MSG_INSTALL_FINISHED - UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) + except: + self.LOG.write( "\n\nImplementation Error\n") + traceback.print_exc(file=self.LOG.OutputFile) + traceback.print_exc() - SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) + if not success: + try: + _debugRun() + except BootManagerException, e: + self.LOG.write( "\n\nException while running: %s\n" % str(e) ) + except: + self.LOG.write( "\n\nImplementation Error\n") + traceback.print_exc(file=self.LOG.OutputFile) + traceback.print_exc() - + return success + + def main(argv): global NodeRunStates NodeRunStates = {'new':None, diff --git a/source/BootServerRequest.py b/source/BootServerRequest.py index efe3d9c..75fad3c 100644 --- a/source/BootServerRequest.py +++ b/source/BootServerRequest.py @@ -2,45 +2,9 @@ # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. import os, sys import re diff --git a/source/Exceptions.py b/source/Exceptions.py index fc81fd3..915f120 100644 --- a/source/Exceptions.py +++ b/source/Exceptions.py @@ -1,3 +1,10 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. class BootManagerException(Exception): def __init__( self, err ): diff --git a/source/ModelOptions.py b/source/ModelOptions.py index ee1cab3..697b701 100644 --- a/source/ModelOptions.py +++ b/source/ModelOptions.py @@ -1,3 +1,12 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + import string MINHW = 0x001 @@ -30,3 +39,4 @@ def Get(model): options = options | modeloptions.get(info,0) return options + diff --git a/source/compatibility.py b/source/compatibility.py index 0b69d43..ab2ab4a 100644 --- a/source/compatibility.py +++ b/source/compatibility.py @@ -1,3 +1,12 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + """ Various functions that are used to allow the boot manager to run on various different cds are included here diff --git a/source/merge_hw_tables.py b/source/merge_hw_tables.py index 9d850d2..036d0e6 100755 --- a/source/merge_hw_tables.py +++ b/source/merge_hw_tables.py @@ -1,4 +1,11 @@ -#!/usr/bin/env python +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + """ The point of this small utility is to take a file in the format diff --git a/source/notify_messages.py b/source/notify_messages.py index f6bfb29..6186fa0 100644 --- a/source/notify_messages.py +++ b/source/notify_messages.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + """ this file contains the ids of messages that we can send the contacts at a site, through the BootNotifyOwners call diff --git a/source/steps/AuthenticateWithPLC.py b/source/steps/AuthenticateWithPLC.py index bad3c16..55511dc 100644 --- a/source/steps/AuthenticateWithPLC.py +++ b/source/steps/AuthenticateWithPLC.py @@ -1,8 +1,16 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + import os from Exceptions import * import BootAPI -import StartDebug AUTH_FAILURE_COUNT_FILE= "/tmp/authfailurecount" @@ -71,8 +79,6 @@ def Run( vars, log ): log.write( "Maximum number of authentication failures reached.\n" ) log.write( "Canceling boot process and going into debug mode.\n" ) - StartDebug.Run( vars, log ) - raise BootManagerException, "Unable to authenticate node." diff --git a/source/steps/ChainBootNode.py b/source/steps/ChainBootNode.py index e2d2e89..c96ac38 100644 --- a/source/steps/ChainBootNode.py +++ b/source/steps/ChainBootNode.py @@ -1,13 +1,21 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + import string import re import os -import InstallWriteConfig import UpdateBootStateWithPLC from Exceptions import * import utils import compatibility -from systeminfo import systeminfo +import systeminfo import BootAPI import notify_messages @@ -54,6 +62,10 @@ def Run( vars, log ): NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"] + PARTITIONS= vars["PARTITIONS"] + if PARTITIONS == None: + raise ValueError, "PARTITIONS" + except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: @@ -73,26 +85,28 @@ def Run( 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() + systeminfo.get_block_device_list(vars, log) utils.sysexec( "vgscan", log ) utils.sysexec( "vgchange -ay planetlab", log ) utils.makedirs( SYSIMG_PATH ) - utils.sysexec( "mount /dev/planetlab/root %s" % SYSIMG_PATH, log ) - utils.sysexec( "mount /dev/planetlab/vservers %s/vservers" % - SYSIMG_PATH, log ) - utils.sysexec( "mount -t proc none %s/proc" % SYSIMG_PATH, log ) + cmd = "mount %s %s" % (PARTITIONS["root"],SYSIMG_PATH) + utils.sysexec( cmd, log ) + cmd = "mount %s %s/vservers" % (PARTITIONS["vservers"],SYSIMG_PATH) + utils.sysexec( cmd, log ) + cmd = "mount -t proc none %s/proc" % SYSIMG_PATH + utils.sysexec( cmd, log ) ROOT_MOUNTED= 1 vars['ROOT_MOUNTED']= 1 - node_update_cmd= "/usr/local/planetlab/bin/NodeUpdate.py start noreboot" - log.write( "Running node update.\n" ) - utils.sysexec( "chroot %s %s" % (SYSIMG_PATH,node_update_cmd), log ) + cmd = "chroot %s /usr/local/planetlab/bin/NodeUpdate.py start noreboot" \ + % SYSIMG_PATH + utils.sysexec( cmd, log ) log.write( "Updating ssh public host key with PLC.\n" ) ssh_host_key= "" @@ -119,12 +133,6 @@ def Run( vars, log ): update_vals['ssh_host_key']= ssh_host_key BootAPI.call_api_function( vars, "BootUpdateNode", (update_vals,) ) - # rewrite modprobe.conf in case there were any module changes - # from a new kernel installed. - log.write( "Rewriting /etc/modprobe.conf\n" ) - (network_count,storage_count)= \ - InstallWriteConfig.write_modprobeconf_file( vars, log ) - # get the kernel version option = '' if NODE_MODEL_OPTIONS & ModelOptions.SMP: @@ -141,28 +149,15 @@ def Run( vars, log ): utils.sysexec_noerr( "chroot %s umount /rcfs" % SYSIMG_PATH, log ) except OSError, e: pass + utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH, log ) - utils.sysexec_noerr( "umount -r /dev/planetlab/vservers", log ) - utils.sysexec_noerr( "umount -r /dev/planetlab/root", log ) + utils.sysexec_noerr( "umount -r %s/vservers" % SYSIMG_PATH, log ) + utils.sysexec_noerr( "umount -r %s" % SYSIMG_PATH, log ) utils.sysexec_noerr( "vgchange -an", log ) ROOT_MOUNTED= 0 vars['ROOT_MOUNTED']= 0 - # before we do the real kexec, check to see if we had any - # network drivers written to modprobe.conf. if not, return -1, - # which will cause this node to be switched to a debug state. - if network_count == 0: - log.write( "\nIt appears we don't have any network drivers. Aborting.\n" ) - - vars['BOOT_STATE']= 'dbg' - vars['STATE_CHANGE_NOTIFY']= 1 - vars['STATE_CHANGE_NOTIFY_MESSAGE']= \ - notify_messages.MSG_NO_DETECTED_NETWORK - UpdateBootStateWithPLC.Run( vars, log ) - - return - log.write( "Unloading modules and chain booting to new kernel.\n" ) # further use of log after Upload will only output to screen @@ -242,7 +237,7 @@ def Run( vars, log ): log.write( "Couldn't read /proc/modules, continuing.\n" ) - kargs = "root=/dev/mapper/planetlab-root ramdisk_size=8192" + kargs = "root=%s ramdisk_size=8192" % PARTITIONS["mapper-root"] if NODE_MODEL_OPTIONS & ModelOptions.SMP: kargs = kargs + " " + "acpi=off" try: diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index 11e6a88..0d17cff 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -1,8 +1,16 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + import string import InstallPartitionDisks from Exceptions import * -from systeminfo import systeminfo +import systeminfo import compatibility import utils import os @@ -34,15 +42,17 @@ def Run( vars, log ): raise ValueError, "SYSIMG_PATH" MINIMUM_DISK_SIZE= int(vars["MINIMUM_DISK_SIZE"]) + + PARTITIONS= vars["PARTITIONS"] + if PARTITIONS == None: + raise ValueError, "PARTITIONS" except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var - sysinfo= systeminfo() - - all_devices= sysinfo.get_block_device_list() + all_devices= systeminfo.get_block_device_list(vars, log) # find out if there are unused disks in all_devices that are greater # than old cds need extra utilities to run lvm @@ -77,8 +87,8 @@ def Run( vars, log ): # this is the lvm partition, if it exists on that device lvm_partition= "%s1" % device - already_added= utils.sysexec_noerr( "pvdisplay %s | grep -q 'planetlab'" % - lvm_partition ) + cmd = "pvdisplay %s | grep -q 'planetlab'" % lvm_partition + already_added= utils.sysexec_noerr(cmd, log) if already_added: log.write( "It appears %s is part of the volume group, continuing.\n" % @@ -88,14 +98,15 @@ def Run( vars, log ): # just to be extra paranoid, ignore the device if it already has # an lvm partition on it (new disks won't have this, and that is # what this code is for, so it should be ok). - has_lvm= utils.sysexec_noerr( "sfdisk -l %s | grep -q 'Linux LVM'" % - device ) + cmd = "sfdisk -l %s | grep -q 'Linux LVM'" % device + has_lvm= utils.sysexec_noerr(cmd, log) if has_lvm: - log.write( "It appears %s has/had lvm already setup on "\ - "it, continuing.\n" % device ) - continue + log.write( "It appears %s has lvm already setup on it.\n" % device) + paranoid = False + if paranoid: + log.write("To paranoid to add %s to vservers lvm.\n" % device) + continue - log.write( "Attempting to add %s to the volume group\n" % device ) if not InstallPartitionDisks.single_partition_device( device, vars, log ): @@ -131,38 +142,66 @@ def Run( vars, log ): except OSError, e: pass - utils.sysexec_noerr( "umount /dev/planetlab/vservers", log ) - utils.sysexec_noerr( "umount /dev/planetlab/root", log ) + # umount in order to extend disk size + utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH, log ) + utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH, log ) + utils.sysexec_noerr( "umount %s" % SYSIMG_PATH, log ) utils.sysexec( "vgchange -an", log ) vars['ROOT_MOUNTED']= 0 - if not utils.sysexec_noerr( "vgextend planetlab %s" % - string.join(new_devices," "), log ): - log.write( "Failed to add physical volumes %s to " \ - "volume group, continuing.\n" % string.join(new_devices," ")) - return 1 - - # now, get the number of unused extents, and extend the vserver - # logical volume by that much. - remaining_extents= \ + while True: + cmd = "vgextend planetlab %s" % string.join(new_devices," ") + if not utils.sysexec_noerr( cmd, log ): + log.write( "Failed to add physical volumes %s to " \ + "volume group, continuing.\n" % string.join(new_devices," ")) + res = 1 + break + + # now, get the number of unused extents, and extend the vserver + # logical volume by that much. + remaining_extents= \ InstallPartitionDisks.get_remaining_extents_on_vg( vars, log ) - log.write( "Extending vservers logical volume.\n" ) - - if not utils.sysexec_noerr("lvextend -l +%s /dev/planetlab/vservers" % - remaining_extents, log): - log.write( "Failed to extend vservers logical volume, continuing\n" ) - return 1 - - log.write( "making the ext3 filesystem match new logical volume size.\n" ) - if not utils.sysexec_noerr("resize2fs /dev/planetlab/vservers",log): - log.write( "Failed to make ext3 file system match, continuing\n" ) - return 1 - - log.write( "Succesfully extended vservers partition by %4.2f GB\n" % - extended_gb_size ) + log.write( "Extending vservers logical volume.\n" ) + utils.sysexec( "vgchange -ay", log ) + cmd = "lvextend -l +%s %s" % (remaining_extents, PARTITIONS["vservers"]) + if not utils.sysexec_noerr(cmd, log): + log.write( "Failed to extend vservers logical volume, continuing\n" ) + res = 1 + break + + log.write( "making the ext3 filesystem match new logical volume size.\n" ) + if BOOT_CD_VERSION[0] == 2: + cmd = "resize2fs %s" % PARTITIONS["vservers"] + resize = utils.sysexec_noerr(cmd,log) + elif BOOT_CD_VERSION[0] == 3: + vars['ROOT_MOUNTED']= 1 + cmd = "mount %s %s" % (PARTITIONS["root"],SYSIMG_PATH) + utils.sysexec_noerr( cmd, log ) + cmd = "mount %s %s/vservers" % \ + (PARTITIONS["vservers"],SYSIMG_PATH) + utils.sysexec_noerr( cmd, log ) + cmd = "ext2online %s/vservers" % SYSIMG_PATH + resize = utils.sysexec_noerr(cmd,log) + utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH, log ) + utils.sysexec_noerr( "umount %s" % SYSIMG_PATH, log ) + vars['ROOT_MOUNTED']= 0 + + utils.sysexec( "vgchange -an", log ) + + if not resize: + log.write( "Failed to resize vservers partition, continuing.\n" ) + res = 1 + break + else: + log.write( "Extended vservers partition by %4.2f GB\n" % + extended_gb_size ) + res = 1 + break + else: log.write( "No new disk devices to add to volume group.\n" ) + res = 1 - return 1 + return res diff --git a/source/steps/CheckHardwareRequirements.py b/source/steps/CheckHardwareRequirements.py index bff14f2..7739f73 100644 --- a/source/steps/CheckHardwareRequirements.py +++ b/source/steps/CheckHardwareRequirements.py @@ -1,50 +1,17 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os import popen2 import string -from systeminfo import systeminfo +import systeminfo from Exceptions import * import utils import notify_messages @@ -108,12 +75,10 @@ def Run( vars, log ): raise BootManagerException, \ "Variable in install store blank, shouldn't be: %s" % var - sysinfo= systeminfo() - # lets see if we have enough memory to run log.write( "Checking for available memory.\n" ) - total_mem= sysinfo.get_total_phsyical_mem() + total_mem= systeminfo.get_total_phsyical_mem(vars, log) if total_mem is None: raise BootManagerException, "Unable to read total physical memory" @@ -152,7 +117,7 @@ def Run( vars, log ): # get a list of block devices to attempt to install on # (may include cdrom devices) - install_devices= sysinfo.get_block_device_list() + install_devices= systeminfo.get_block_device_list(vars, log) # save the list of block devices in the log log.write( "Detected block devices:\n" ) diff --git a/source/steps/ConfirmInstallWithUser.py b/source/steps/ConfirmInstallWithUser.py index 3773ea9..7d2a6e3 100644 --- a/source/steps/ConfirmInstallWithUser.py +++ b/source/steps/ConfirmInstallWithUser.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + from Exceptions import * welcome_message= \ diff --git a/source/steps/GetAndUpdateNodeDetails.py b/source/steps/GetAndUpdateNodeDetails.py index be39ef8..3db047d 100644 --- a/source/steps/GetAndUpdateNodeDetails.py +++ b/source/steps/GetAndUpdateNodeDetails.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + import string from Exceptions import * diff --git a/source/steps/InitializeBootManager.py b/source/steps/InitializeBootManager.py index 24abbb4..c916cfd 100644 --- a/source/steps/InitializeBootManager.py +++ b/source/steps/InitializeBootManager.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + import os import xmlrpclib import socket @@ -24,12 +32,24 @@ def Run( vars, log ): hardware setup (to fix old cd problems) Sets the following variables: - BOOT_CD_VERSION A two number tuple of the boot cd version + PARTITIONS A dictionary of generic partition types and their + associated devices. + BOOT_CD_VERSION A two number tuple of the boot cd version """ log.write( "\n\nStep: Initializing the BootManager.\n" ) - + # define the basic partition paths + PARTITIONS= {} + PARTITIONS["root"]= "/dev/planetlab/root" + PARTITIONS["swap"]= "/dev/planetlab/swap" + PARTITIONS["vservers"]= "/dev/planetlab/vservers" + # Linux 2.6 mounts LVM with device mapper + PARTITIONS["mapper-root"]= "/dev/mapper/planetlab-root" + PARTITIONS["mapper-swap"]= "/dev/mapper/planetlab-swap" + PARTITIONS["mapper-vservers"]= "/dev/mapper/planetlab-vservers" + vars["PARTITIONS"]= PARTITIONS + log.write( "Opening connection to API server\n" ) try: api_inst= xmlrpclib.Server( vars['BOOT_API_SERVER'], verbose=0 ) diff --git a/source/steps/InstallBootstrapRPM.py b/source/steps/InstallBootstrapRPM.py index 56ebc09..5937f4d 100644 --- a/source/steps/InstallBootstrapRPM.py +++ b/source/steps/InstallBootstrapRPM.py @@ -1,45 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os, sys, string import popen2 diff --git a/source/steps/InstallBuildVServer.py b/source/steps/InstallBuildVServer.py index 1f63179..169b0fb 100644 --- a/source/steps/InstallBuildVServer.py +++ b/source/steps/InstallBuildVServer.py @@ -1,43 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os diff --git a/source/steps/InstallInit.py b/source/steps/InstallInit.py index eb2c18f..70aa994 100644 --- a/source/steps/InstallInit.py +++ b/source/steps/InstallInit.py @@ -1,45 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os, sys, shutil import string @@ -61,8 +27,8 @@ def Run( vars, log ): PLCONF_DIR The directory to store the configuration file in Sets the following variables: - SYSIMG_PATH the directory where the system image will be mounted, - (= TEMP_PATH/SYSIMG_DIR) + SYSIMG_PATH the directory where the system image will be mounted, + (= TEMP_PATH/SYSIMG_DIR) """ log.write( "\n\nStep: Install: Initializing.\n" ) @@ -99,11 +65,12 @@ def Run( vars, log ): except OSError, e: pass - utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH, log ) - utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH, log ) - utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH, log ) - utils.sysexec_noerr( "umount %s" % SYSIMG_PATH, log ) - + utils.sysexec_noerr( "umount %s/proc" % SYSIMG_PATH ) + utils.sysexec_noerr( "umount %s/mnt/cdrom" % SYSIMG_PATH ) + utils.sysexec_noerr( "umount %s/vservers" % SYSIMG_PATH ) + utils.sysexec_noerr( "umount %s" % SYSIMG_PATH ) + vars['ROOT_MOUNTED']= 0 + log.write( "Removing any old files, directories\n" ) utils.removedir( TEMP_PATH ) diff --git a/source/steps/InstallNodeInit.py b/source/steps/InstallNodeInit.py index c0532d0..126288c 100644 --- a/source/steps/InstallNodeInit.py +++ b/source/steps/InstallNodeInit.py @@ -1,44 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format from Exceptions import * import utils diff --git a/source/steps/InstallPartitionDisks.py b/source/steps/InstallPartitionDisks.py index f36e2e9..d7c6468 100644 --- a/source/steps/InstallPartitionDisks.py +++ b/source/steps/InstallPartitionDisks.py @@ -1,44 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os, sys import string @@ -62,14 +29,6 @@ def Run( vars, log ): ROOT_SIZE the size of the root logical volume SWAP_SIZE the size of the swap partition BOOT_CD_VERSION A tuple of the current bootcd version - - Sets the following variables: - PARTITIONS diction of generic part. types (root/swap) - and their associated devices. - Current keys/values: - root /dev/planetlab/root - swap /dev/planetlab/swap - """ log.write( "\n\nStep: Install: partitioning disks.\n" ) @@ -98,6 +57,10 @@ def Run( vars, log ): NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"] + PARTITIONS= vars["PARTITIONS"] + if PARTITIONS == None: + raise ValueError, "PARTITIONS" + except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: @@ -110,29 +73,15 @@ def Run( vars, log ): if BOOT_CD_VERSION[0] == 2: compatibility.setup_partdisks_2x_cd( vars, log ) - import parted - - # define the basic partition paths - PARTITIONS= {} - PARTITIONS["root"]= "/dev/planetlab/root" - PARTITIONS["swap"]= "/dev/planetlab/swap" - PARTITIONS["vservers"]= "/dev/planetlab/vservers" - # Linux 2.6 mounts LVM with device mapper - PARTITIONS["mapper-root"]= "/dev/mapper/planetlab-root" - PARTITIONS["mapper-swap"]= "/dev/mapper/planetlab-swap" - PARTITIONS["mapper-vservers"]= "/dev/mapper/planetlab-vservers" - vars["PARTITIONS"]= PARTITIONS - - # disable swap if its on utils.sysexec_noerr( "swapoff %s" % PARTITIONS["swap"], log ) # shutdown and remove any lvm groups/volumes utils.sysexec_noerr( "vgscan", log ) utils.sysexec_noerr( "vgchange -ay", log ) - utils.sysexec_noerr( "lvremove -f /dev/planetlab/root", log ) - utils.sysexec_noerr( "lvremove -f /dev/planetlab/swap", log ) - utils.sysexec_noerr( "lvremove -f /dev/planetlab/vservers", log ) + utils.sysexec_noerr( "lvremove -f %s" % PARTITIONS["root"], log ) + utils.sysexec_noerr( "lvremove -f %s" % PARTITIONS["swap"], log ) + utils.sysexec_noerr( "lvremove -f %s" % PARTITIONS["vservers"], log ) utils.sysexec_noerr( "vgchange -an", log ) utils.sysexec_noerr( "vgremove planetlab", log ) @@ -205,9 +154,7 @@ def Run( vars, log ): utils.sysexec( "mkfs.ext2 -q %s -m %d -j %s" % (option,rbp,devname), log ) # save the list of block devices in the log - log.write( "Block devices used (in lvm):\n" ) - log.write( repr(used_devices) + "\n" ) - log.write( "End of block devices used (in lvm).\n" ) + log.write( "Block devices used (in lvm): %s\n" % repr(used_devices)) # list of block devices used may be updated vars["INSTALL_BLOCK_DEVICES"]= used_devices diff --git a/source/steps/InstallUninitHardware.py b/source/steps/InstallUninitHardware.py index 884c65d..a54534f 100644 --- a/source/steps/InstallUninitHardware.py +++ b/source/steps/InstallUninitHardware.py @@ -1,44 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os diff --git a/source/steps/InstallWriteConfig.py b/source/steps/InstallWriteConfig.py index a0dfac5..2d1582c 100644 --- a/source/steps/InstallWriteConfig.py +++ b/source/steps/InstallWriteConfig.py @@ -1,50 +1,17 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os, string from Exceptions import * import utils -from systeminfo import systeminfo +import systeminfo import BootAPI import ModelOptions @@ -53,11 +20,7 @@ def Run( vars, log ): """ Writes out the following configuration files for the node: /etc/fstab - /etc/hosts - /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/resolv.conf (if applicable) - /etc/sysconfig/network - /etc/modprobe.conf /etc/ssh/ssh_host_key /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key @@ -111,25 +74,10 @@ def Run( vars, log ): except ValueError, var: raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var - try: - # we need to keys in PARTITIONS, root and swap, make sure - # they exist - val= PARTITIONS["root"] - val= PARTITIONS["swap"] - val= PARTITIONS["vservers"] - val= PARTITIONS["mapper-root"] - val= PARTITIONS["mapper-swap"] - val= PARTITIONS["mapper-vservers"] - except KeyError, part: - log.write( "Missing partition in PARTITIONS: %s\n" % part ) - return 0 - - log.write( "Setting local time to UTC\n" ) utils.sysexec( "chroot %s ln -sf /usr/share/zoneinfo/UTC /etc/localtime" % \ SYSIMG_PATH, log ) - log.write( "Enabling ntp at boot\n" ) utils.sysexec( "chroot %s chkconfig ntpd on" % SYSIMG_PATH, log ) @@ -138,32 +86,6 @@ def Run( vars, log ): log.write( "Unable to create directory\n" ) return 0 - - log.write( "Writing network configuration\n" ) - write_network_configuration( vars, log ) - - # write out the modprobe.conf file for the system. make sure - # the order of the ethernet devices are listed in the same order - # as the boot cd loaded the modules. this is found in /tmp/loadedmodules - # ultimately, the order will only match the boot cd order if - # the kernel modules have the same name - which should be true for the later - # version boot cds because they use the same kernel version. - # older boot cds use a 2.4.19 kernel, and its possible some of the network - # module names have changed, in which case the system might not boot - # if the network modules are activated in a different order that the - # boot cd. - log.write( "Writing /etc/modprobe.conf\n" ) - write_modprobeconf_file( vars, log ) - - # dump the modprobe.conf file to the log (not to screen) - log.write( "Contents of new modprobe.conf file:\n" ) - modulesconf_file= file("%s/etc/modprobe.conf" % SYSIMG_PATH, "r" ) - contents= modulesconf_file.read() - log.write( contents + "\n" ) - modulesconf_file.close() - modulesconf_file= None - log.write( "End contents of new modprobe.conf file.\n" ) - log.write( "Writing system /etc/fstab\n" ) fstab= file( "%s/etc/fstab" % SYSIMG_PATH, "w" ) fstab.write( "%s none swap sw 0 0\n" % \ @@ -227,7 +149,7 @@ def Run( vars, log ): rootdev= file( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]), "w" ) rootdev.close() - initrd, kernel_version= getKernelVersion(vars,log) + initrd, kernel_version= systeminfo.getKernelVersion(vars,log) utils.removefile( "%s/boot/%s" % (SYSIMG_PATH, initrd) ) utils.sysexec( "chroot %s mkinitrd /boot/initrd-%s.img %s" % \ (SYSIMG_PATH, kernel_version, kernel_version), log ) @@ -266,209 +188,3 @@ def Run( vars, log ): utils.sysexec( "chmod 644 %s/%s.pub" % (SYSIMG_PATH,key_file), log ) return 1 - - - -def write_network_configuration( vars, log ): - """ - Write out the network configuration for this machine: - /etc/hosts - /etc/sysconfig/network-scripts/ifcfg-eth0 - /etc/resolv.conf (if applicable) - /etc/sysconfig/network - - It is assumed the caller mounted the root partition and the vserver partition - starting on SYSIMG_PATH - it is not checked here. - - The values to be used for the network settings are to be set in vars - in the variable 'NETWORK_SETTINGS', which is a dictionary - with keys: - - Key Used by this function - ----------------------------------------------- - node_id - node_key - method x - ip x - mac x (optional) - gateway x - network x - broadcast x - netmask x - dns1 x - dns2 x (optional) - hostname x - domainname x - """ - - try: - SYSIMG_PATH= vars["SYSIMG_PATH"] - if SYSIMG_PATH == "": - raise ValueError, "SYSIMG_PATH" - - except KeyError, var: - raise BootManagerException, "Missing variable in vars: %s\n" % var - except ValueError, var: - raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var - - - try: - network_settings= vars['NETWORK_SETTINGS'] - except KeyError, e: - raise BootManagerException, "No network settings found in vars." - - try: - hostname= network_settings['hostname'] - domainname= network_settings['domainname'] - method= network_settings['method'] - ip= network_settings['ip'] - gateway= network_settings['gateway'] - network= network_settings['network'] - netmask= network_settings['netmask'] - dns1= network_settings['dns1'] - mac= network_settings['mac'] - except KeyError, e: - raise BootManagerException, "Missing value %s in network settings." % str(e) - - try: - dns2= '' - dns2= network_settings['dns2'] - except KeyError, e: - pass - - - log.write( "Writing /etc/hosts\n" ) - hosts_file= file("%s/etc/hosts" % SYSIMG_PATH, "w" ) - hosts_file.write( "127.0.0.1 localhost\n" ) - if method == "static": - hosts_file.write( "%s %s.%s\n" % (ip, hostname, domainname) ) - hosts_file.close() - hosts_file= None - - - log.write( "Writing /etc/sysconfig/network-scripts/ifcfg-eth0\n" ) - eth0_file= file("%s/etc/sysconfig/network-scripts/ifcfg-eth0" % - SYSIMG_PATH, "w" ) - eth0_file.write( "DEVICE=eth0\n" ) - if method == "static": - eth0_file.write( "BOOTPROTO=static\n" ) - eth0_file.write( "IPADDR=%s\n" % ip ) - eth0_file.write( "NETMASK=%s\n" % netmask ) - eth0_file.write( "GATEWAY=%s\n" % gateway ) - else: - eth0_file.write( "BOOTPROTO=dhcp\n" ) - eth0_file.write( "DHCP_HOSTNAME=%s\n" % hostname ) - if mac != "": - eth0_file.write( "HWADDR=%s\n" % mac ) - eth0_file.write( "ONBOOT=yes\n" ) - eth0_file.write( "USERCTL=no\n" ) - eth0_file.close() - eth0_file= None - - if method == "static": - log.write( "Writing /etc/resolv.conf\n" ) - resolv_file= file("%s/etc/resolv.conf" % SYSIMG_PATH, "w" ) - if dns1 != "": - resolv_file.write( "nameserver %s\n" % dns1 ) - if dns2 != "": - resolv_file.write( "nameserver %s\n" % dns2 ) - resolv_file.write( "search %s\n" % domainname ) - resolv_file.close() - resolv_file= None - - log.write( "Writing /etc/sysconfig/network\n" ) - network_file= file("%s/etc/sysconfig/network" % SYSIMG_PATH, "w" ) - network_file.write( "NETWORKING=yes\n" ) - network_file.write( "HOSTNAME=%s.%s\n" % (hostname, domainname) ) - if method == "static": - network_file.write( "GATEWAY=%s\n" % gateway ) - network_file.close() - network_file= None - - - -def write_modprobeconf_file( vars, log, filename = "/etc/modprobe.conf"): - """ - write out the system file /etc/modprobe.conf with the current - set of modules. - - returns a tuple of the number of network driver lines and storage - driver lines written as (networkcount,storagecount) - """ - - # make sure we have this class loaded - from systeminfo import systeminfo - - try: - SYSIMG_PATH= vars["SYSIMG_PATH"] - if SYSIMG_PATH == "": - raise ValueError, "SYSIMG_PATH" - - except KeyError, var: - raise BootManagerException, "Missing variable in vars: %s\n" % var - except ValueError, var: - raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var - - initrd, kernel_version= getKernelVersion(vars,log) - sysinfo= systeminfo() - sysmods= sysinfo.get_system_modules(SYSIMG_PATH, kernel_version) - if sysmods is None: - raise BootManagerException, "Unable to get list of system modules." - - eth_count= 0 - scsi_count= 0 - - modulesconf_file= file("%s/%s" % (SYSIMG_PATH,filename), "w" ) - - for type in sysmods: - if type == sysinfo.MODULE_CLASS_SCSI: - for a_mod in sysmods[type]: - if scsi_count == 0: - modulesconf_file.write( "alias scsi_hostadapter %s\n" % - a_mod ) - else: - modulesconf_file.write( "alias scsi_hostadapter%d %s\n" % - (scsi_count,a_mod) ) - scsi_count= scsi_count + 1 - - elif type == sysinfo.MODULE_CLASS_NETWORK: - for a_mod in sysmods[type]: - modulesconf_file.write( "alias eth%d %s\n" % - (eth_count,a_mod) ) - eth_count= eth_count + 1 - - modulesconf_file.close() - modulesconf_file= None - - return (eth_count,scsi_count) - -def getKernelVersion( vars, log): - # make sure we have the variables we need - try: - SYSIMG_PATH= vars["SYSIMG_PATH"] - if SYSIMG_PATH == "": - raise ValueError, "SYSIMG_PATH" - - NODE_MODEL_OPTIONS=vars["NODE_MODEL_OPTIONS"] - except KeyError, var: - raise BootManagerException, "Missing variable in vars: %s\n" % var - except ValueError, var: - raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var - - option = '' - if NODE_MODEL_OPTIONS & ModelOptions.SMP: - option = 'smp' - try: - os.stat("%s/boot/kernel-boot%s" % (SYSIMG_PATH,option)) - os.stat("%s/boot/initrd-boot%s" % (SYSIMG_PATH,option)) - except OSError, e: - # smp kernel is not there; remove option from modeloptions - # such that the rest of the code base thinks we are just - # using the base kernel. - NODE_MODEL_OPTIONS = NODE_MODEL_OPTIONS & ~ModelOptions.SMP - vars["NODE_MODEL_OPTIONS"] = NODE_MODEL_OPTIONS - log.write( "WARNING: Couldn't locate smp kernel.\n") - option = '' - initrd= os.readlink( "%s/boot/initrd-boot%s" % (SYSIMG_PATH,option) ) - kernel_version= initrd.replace("initrd-", "").replace(".img", "") - return (initrd, kernel_version) diff --git a/source/steps/ReadNodeConfiguration.py b/source/steps/ReadNodeConfiguration.py index 99e1a8c..c04cadf 100644 --- a/source/steps/ReadNodeConfiguration.py +++ b/source/steps/ReadNodeConfiguration.py @@ -1,44 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import sys, os, traceback import string @@ -49,7 +16,6 @@ import utils from Exceptions import * import BootServerRequest import BootAPI -import StartDebug import notify_messages import UpdateBootStateWithPLC @@ -659,8 +625,6 @@ def __parse_configuration_file( vars, log, file_contents ): if not hostname_resolve_ok: log.write( "Hostname does not resolve correctly, will not continue.\n" ) - StartDebug.Run( vars, log ) - if can_make_api_call: log.write( "Notifying contacts of problem.\n" ) diff --git a/source/steps/SendHardwareConfigToPLC.py b/source/steps/SendHardwareConfigToPLC.py index 4d8fa0c..3f9fb9b 100644 --- a/source/steps/SendHardwareConfigToPLC.py +++ b/source/steps/SendHardwareConfigToPLC.py @@ -1,3 +1,12 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + from Exceptions import * diff --git a/source/steps/StartDebug.py b/source/steps/StartDebug.py index ebb7858..6220704 100644 --- a/source/steps/StartDebug.py +++ b/source/steps/StartDebug.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + import os from Exceptions import * diff --git a/source/steps/UpdateBootStateWithPLC.py b/source/steps/UpdateBootStateWithPLC.py index 417dd12..001dcd9 100644 --- a/source/steps/UpdateBootStateWithPLC.py +++ b/source/steps/UpdateBootStateWithPLC.py @@ -1,3 +1,11 @@ +#!/usr/bin/python2 -u + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + from Exceptions import * import BootAPI import notify_messages @@ -27,24 +35,25 @@ def Run( vars, log ): log.write( "Successfully updated boot state for this node at PLC\n" ) - if "STATE_CHANGE_NOTIFY" in vars.keys(): - if vars["STATE_CHANGE_NOTIFY"] == 1: - message= vars['STATE_CHANGE_NOTIFY_MESSAGE'] - include_pis= 0 - include_techs= 1 - include_support= 0 - - sent= 0 - try: - sent= BootAPI.call_api_function( vars, "BootNotifyOwners", - (message, - include_pis, - include_techs, - include_support) ) - except BootManagerException, e: - log.write( "Call to BootNotifyOwners failed: %s.\n" % e ) - - if sent == 0: - log.write( "Unable to notify site contacts of state change.\n" ) - + notify = vars.get("STATE_CHANGE_NOTIFY",0) + + if notify: + message= vars['STATE_CHANGE_NOTIFY_MESSAGE'] + include_pis= 0 + include_techs= 1 + include_support= 0 + + sent= 0 + try: + sent= BootAPI.call_api_function( vars, "BootNotifyOwners", + (message, + include_pis, + include_techs, + include_support) ) + except BootManagerException, e: + log.write( "Call to BootNotifyOwners failed: %s.\n" % e ) + + if sent == 0: + log.write( "Unable to notify site contacts of state change.\n" ) + return 1 diff --git a/source/steps/UpdateNodeConfiguration.py b/source/steps/UpdateNodeConfiguration.py index 2c8ea1b..ec74bc2 100644 --- a/source/steps/UpdateNodeConfiguration.py +++ b/source/steps/UpdateNodeConfiguration.py @@ -1,6 +1,14 @@ +#!/usr/bin/python2 -u + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + import os -import InstallWriteConfig import InstallBuildVServer from Exceptions import * import utils @@ -60,11 +68,6 @@ def Run( vars, log ): if not ROOT_MOUNTED: raise BootManagerException, "Root isn't mounted on SYSIMG_PATH\n" - - log.write( "Updating node network configuration\n" ) - InstallWriteConfig.write_network_configuration( vars, log ) - - log.write( "Updating vserver's /etc/hosts and /etc/resolv.conf files\n" ) # create a list of the full directory paths of all the vserver images that diff --git a/source/steps/ValidateNodeInstall.py b/source/steps/ValidateNodeInstall.py index 7b7ed8a..30cb0af 100644 --- a/source/steps/ValidateNodeInstall.py +++ b/source/steps/ValidateNodeInstall.py @@ -1,8 +1,16 @@ +#!/usr/bin/python2 -u + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + import os from Exceptions import * import utils -from systeminfo import systeminfo +import systeminfo import compatibility import ModelOptions @@ -47,6 +55,10 @@ def Run( vars, log ): NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"] + PARTITIONS= vars["PARTITIONS"] + if PARTITIONS == None: + raise ValueError, "PARTITIONS" + except KeyError, var: raise BootManagerException, "Missing variable in vars: %s\n" % var except ValueError, var: @@ -68,7 +80,7 @@ def Run( 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() + systeminfo.get_block_device_list(vars, log) try: utils.sysexec( "vgscan", log ) @@ -81,9 +93,9 @@ def Run( vars, log ): utils.makedirs( SYSIMG_PATH ) try: - utils.sysexec( "mount /dev/planetlab/root %s" % SYSIMG_PATH, log ) - utils.sysexec( "mount /dev/planetlab/vservers %s/vservers" % - SYSIMG_PATH, log ) + utils.sysexec("mount %s %s" % (PARTITIONS["root"],SYSIMG_PATH),log) + utils.sysexec("mount %s %s/vservers" % \ + (PARTITIONS["vservers"], SYSIMG_PATH), log) utils.sysexec( "mount -t proc none %s/proc" % SYSIMG_PATH, log ) except BootManagerException, e: log.write( "BootManagerException during vgscan/vgchange: %s\n" % diff --git a/source/steps/__init__.py b/source/steps/__init__.py index a9ca03d..912c6ff 100644 --- a/source/steps/__init__.py +++ b/source/steps/__init__.py @@ -1,3 +1,12 @@ +#!/usr/bin/python2 + +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + """ This directory contains individual step classes """ @@ -21,4 +30,6 @@ __all__ = ["ReadNodeConfiguration", "InstallNodeInit", "InstallPartitionDisks", "InstallUninitHardware", - "InstallWriteConfig"] + "InstallWriteConfig", + "WriteNetworkConfig", + "WriteModprobeConfig"] diff --git a/source/systeminfo.py b/source/systeminfo.py index 5840ab0..966c149 100755 --- a/source/systeminfo.py +++ b/source/systeminfo.py @@ -1,55 +1,13 @@ #!/usr/bin/python2 -# -------------- -# THIS file used to be named 'blockdevicescan.py', but has been renamed -# systeminfo.py and made more generic (now includes info about memory, -# and other hardware info on the machine) -# -------------- - # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format -# expected /proc/partitions format -# #---------------------------------------------------- #major minor #blocks name # @@ -62,411 +20,399 @@ import string +import sys import os import popen2 import merge_hw_tables import re +import errno +import ModelOptions +from Exceptions import * hwdatapath = "usr/share/hwdata" -class systeminfo: - """ - a utility class for finding and returning information about - block devices, memory, and other hardware on the system - """ - - PROC_MEMINFO_PATH= "/proc/meminfo" +""" +a utility class for finding and returning information about +block devices, memory, and other hardware on the system +""" +PROC_MEMINFO_PATH= "/proc/meminfo" +PROC_PARTITIONS_PATH= "/proc/partitions" - PROC_PARTITIONS_PATH= "/proc/partitions" +# set when the sfdisk -l trick has been done to make +# all devices show up +DEVICES_SCANNED_FLAG= "/tmp/devices_scanned" - # set when the sfdisk -l trick has been done to make - # all devices show up - DEVICES_SCANNED_FLAG= "/tmp/devices_scanned" - - # a /proc/partitions block is 1024 bytes - # a GB to a HDD manufacturer is 10^9 bytes - BLOCKS_PER_GB = pow(10, 9) / 1024.0; - - - # -n is numeric ids (no lookup), -m is machine readable - LSPCI_CMD= "/sbin/lspci -nm" - - MODULE_CLASS_NETWORK= "network" - MODULE_CLASS_SCSI= "scsi" - - PCI_CLASS_NETWORK_ETHERNET=0x0200L - PCI_CLASS_STORAGE_SCSI=0x0100L - PCI_CLASS_STORAGE_IDE=0x0101L - PCI_CLASS_STORAGE_FLOPPY=0x0102L - PCI_CLASS_STORAGE_IPI=0x0103L - PCI_CLASS_STORAGE_RAID=0x0104L - PCI_CLASS_STORAGE_OTHER=0x0180L - - PCI_ANY=0xffffffffL - - def get_total_phsyical_mem(self): - """ - return the total physical memory of the machine, in kilobytes. - - Return None if /proc/meminfo not readable. - """ - - try: - meminfo_file= file(self.PROC_MEMINFO_PATH,"r") - except IOError, e: - return +# a /proc/partitions block is 1024 bytes +# a GB to a HDD manufacturer is 10^9 bytes +BLOCKS_PER_GB = pow(10, 9) / 1024.0; - total_memory= None - - for line in meminfo_file: - try: - (fieldname,value)= string.split(line,":") - except ValueError, e: - # this will happen for lines that don't have two values - # (like the first line on 2.4 kernels) - continue +# -n is numeric ids (no lookup), -m is machine readable +LSPCI_CMD= "/sbin/lspci -nm" - fieldname= string.strip(fieldname) - value= string.strip(value) - - if fieldname == "MemTotal": - try: - (total_memory,units)= string.split(value) - except ValueError, e: - return - - if total_memory == "" or total_memory == None or \ - units == "" or units == None: - return +MODULE_CLASS_NETWORK= "network" +MODULE_CLASS_SCSI= "scsi" - if string.lower(units) != "kb": - return +PCI_CLASS_NETWORK_ETHERNET=0x0200L +PCI_CLASS_STORAGE_SCSI=0x0100L +PCI_CLASS_STORAGE_IDE=0x0101L +PCI_CLASS_STORAGE_FLOPPY=0x0102L +PCI_CLASS_STORAGE_IPI=0x0103L +PCI_CLASS_STORAGE_RAID=0x0104L +PCI_CLASS_STORAGE_OTHER=0x0180L - try: - total_memory= int(total_memory) - except ValueError, e: - return +PCI_ANY=0xffffffffL - break +def get_total_phsyical_mem(vars = {}, log = sys.stderr): + """ + return the total physical memory of the machine, in kilobytes. - meminfo_file.close() + Return None if /proc/meminfo not readable. + """ - return total_memory + try: + meminfo_file= file(PROC_MEMINFO_PATH,"r") + except IOError, e: + return + total_memory= None + for line in meminfo_file: - def get_block_device_list(self): - """ - get a list of block devices from this system. - return an associative array, where the device name - (full /dev/device path) is the key, and the value - is a tuple of (major,minor,numblocks,gb_size,readonly) - """ + try: + (fieldname,value)= string.split(line,":") + except ValueError, e: + # this will happen for lines that don't have two values + # (like the first line on 2.4 kernels) + continue + + fieldname= string.strip(fieldname) + value= string.strip(value) - # make sure we can access to the files/directories in /proc - if not os.access(self.PROC_PARTITIONS_PATH, os.F_OK): - return None + if fieldname == "MemTotal": + try: + (total_memory,units)= string.split(value) + except ValueError, e: + return + if total_memory == "" or total_memory == None or \ + units == "" or units == None: + return - # only do this once every system boot - if not os.access(self.DEVICES_SCANNED_FLAG, os.R_OK): - - # this is ugly. under devfs, device - # entries in /dev/scsi/.. and /dev/ide/... - # don't show up until you attempt to read - # from the associated device at /dev (/dev/sda). - # so, lets run sfdisk -l (list partitions) against - # most possible block devices, that way they show - # up when it comes time to do the install. - for dev_prefix in ('sd','hd'): - block_dev_num= 0 - while block_dev_num < 10: - if block_dev_num < 26: - devicename= "/dev/%s%c" % \ - (dev_prefix, chr(ord('a')+block_dev_num)) - else: - devicename= "/dev/%s%c%c" % \ - ( dev_prefix, - chr(ord('a')+((block_dev_num/26)-1)), - chr(ord('a')+(block_dev_num%26)) ) - - os.system( "sfdisk -l %s > /dev/null 2>&1" % devicename ) - block_dev_num = block_dev_num + 1 - - additional_scan_devices= ("/dev/cciss/c0d0p", "/dev/cciss/c0d1p", - "/dev/cciss/c0d2p", "/dev/cciss/c0d3p", - "/dev/cciss/c0d4p", "/dev/cciss/c0d5p", - "/dev/cciss/c0d6p", "/dev/cciss/c0d7p", - "/dev/cciss/c1d0p", "/dev/cciss/c1d1p", - "/dev/cciss/c1d2p", "/dev/cciss/c1d3p", - "/dev/cciss/c1d4p", "/dev/cciss/c1d5p", - "/dev/cciss/c1d6p", "/dev/cciss/c1d7p",) - - for devicename in additional_scan_devices: - os.system( "sfdisk -l %s > /dev/null 2>&1" % devicename ) + if string.lower(units) != "kb": + return - os.system( "touch %s" % self.DEVICES_SCANNED_FLAG ) - + try: + total_memory= int(total_memory) + except ValueError, e: + return - devicelist= {} + break - partitions_file= file(self.PROC_PARTITIONS_PATH,"r") - line_count= 0 - - for line in partitions_file: - line_count= line_count + 1 + meminfo_file.close() + return total_memory - # skip the first two lines always - if line_count < 2: - continue +def get_block_device_list(vars = {}, log = sys.stderr): + """ + get a list of block devices from this system. + return an associative array, where the device name + (full /dev/device path) is the key, and the value + is a tuple of (major,minor,numblocks,gb_size,readonly) + """ - parts= string.split(line) + # make sure we can access to the files/directories in /proc + if not os.access(PROC_PARTITIONS_PATH, os.F_OK): + return None + + # table with valid scsi/sata/ide/raid block device names + valid_blk_names = {} + # add in valid sd and hd block device names + for blk_prefix in ('sd','hd'): + for blk_num in map ( \ + lambda x: chr(x), range(ord('a'),ord('z')+1)): + devicename="%s%c" % (blk_prefix, blk_num) + valid_blk_names[devicename]=None + + # add in valid scsi raid block device names + for M in range(0,1+1): + for N in range(0,7+1): + devicename = "cciss/c%dd%d" % (M,N) + valid_blk_names[devicename]=None + + # only do this once every system boot + if not os.access(DEVICES_SCANNED_FLAG, os.R_OK): + + # this is ugly. under devfs, device + # entries in /dev/scsi/.. and /dev/ide/... + # don't show up until you attempt to read + # from the associated device at /dev (/dev/sda). + # so, lets run sfdisk -l (list partitions) against + # most possible block devices, that way they show + # up when it comes time to do the install. + devicenames = valid_blk_names.keys() + devicenames.sort() + for devicename in devicenames: + os.system( "sfdisk -l /dev/%s > /dev/null 2>&1" % devicename ) + + # touch file + fb = open(DEVICES_SCANNED_FLAG,"w") + fb.close() + + devicelist= {} + + partitions_file= file(PROC_PARTITIONS_PATH,"r") + line_count= 0 + for line in partitions_file: + line_count= line_count + 1 + + # skip the first two lines always + if line_count < 2: + continue + + parts= string.split(line) + + if len(parts) < 4: + continue + + device= parts[3] + + # skip and ignore any partitions + if not valid_blk_names.has_key(device): + continue - if len(parts) < 4: - continue - - device= parts[3] + try: + major= int(parts[0]) + minor= int(parts[1]) + blocks= int(parts[2]) + except ValueError, err: + continue - dev_name= "/dev/%s" % device - - try: - major= int(parts[0]) - minor= int(parts[1]) - blocks= int(parts[2]) - except ValueError, err: - continue - - # skip and ignore any partitions - if minor != 0: - continue - - gb_size= blocks/self.BLOCKS_PER_GB - - # parse the output of hdparm to get the readonly flag; - # if this fails, assume it isn't read only - readonly= 0 - - hdparm_cmd = popen2.Popen3("hdparm %s 2> /dev/null" % dev_name) - status= hdparm_cmd.wait() - - if os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0: - try: - hdparm_output= hdparm_cmd.fromchild.read() - hdparm_cmd= None - - # parse the output of hdparm, the lines we are interested - # in look - # like: - # - # readonly = 0 (off) - # - - for line in string.split(hdparm_output,"\n"): - - line= string.strip(line) - if line == "": - continue - - line_parts= string.split(line,"=") - if len(line_parts) < 2: - continue - - name= string.strip(line_parts[0]) - - if name == "readonly": - value= string.strip(line_parts[1]) - if len(value) == 0: - break - - if value[0] == "1": - readonly= 1 - break - - except IOError: - pass - - devicelist[dev_name]= (major,minor,blocks,gb_size,readonly) + gb_size= blocks/BLOCKS_PER_GB - - return devicelist + # check to see if the blk device is readonly + try: + # can we write to it? + dev_name= "/dev/%s" % device + fb = open(dev_name,"w") + fb.close() + readonly=False + except IOError, e: + # check if EROFS errno + if errno.errorcode.get(e.errno,None) == 'EROFS': + readonly=True + else: + # got some other errno, pretend device is readonly + readonly=True + devicelist[dev_name]= (major,minor,blocks,gb_size,readonly) + return devicelist - def get_system_modules( self, install_root, kernel_version= None ): - """ - Return a list of kernel modules that this system requires. - This requires access to the installed system's root - directory, as the following files must exist and are used: - /usr/share/hwdata/pcitable - /lib/modules/(first entry if kernel_version unspecified)/modules.pcimap - /lib/modules/(first entry if kernel version unspecified)/modules.dep - If there are more than one kernels installed, and the kernel - version is not specified, then only the first one in - /lib/modules is used. +def get_system_modules( vars = {}, log = sys.stderr): + """ + Return a list of kernel modules that this system requires. + This requires access to the installed system's root + directory, as the following files must exist and are used: + /usr/share/hwdata/pcitable + /lib/modules/(first entry if kernel_version unspecified)/modules.pcimap + /lib/modules/(first entry if kernel version unspecified)/modules.dep + + If there are more than one kernels installed, and the kernel + version is not specified, then only the first one in + /lib/modules is used. + + Returns a dictionary, keys being the type of module: + - scsi MODULE_CLASS_SCSI + - network MODULE_CLASS_NETWORK + The value being the kernel module name to load. + + Some sata devices show up under an IDE device class, + hence the reason for checking for ide devices as well. + If there actually is a match in the pci -> module lookup + table, and its an ide device, its most likely sata, + as ide modules are built in to the kernel. + """ - Returns a dictionary, keys being the type of module: - - scsi MODULE_CLASS_SCSI - - network MODULE_CLASS_NETWORK - The value being the kernel module name to load. + if not vars.has_key("SYSIMG_PATH"): + vars["SYSIMG_PATH"]="/" + SYSIMG_PATH=vars["SYSIMG_PATH"] - Some sata devices show up under an IDE device class, - hence the reason for checking for ide devices as well. - If there actually is a match in the pci -> module lookup - table, and its an ide device, its most likely sata, - as ide modules are built in to the kernel. - """ + if not vars.has_key("NODE_MODEL_OPTIONS"): + vars["NODE_MODEL_OPTIONS"] = 0; - # get the kernel version we are assuming - if kernel_version is None: - try: - kernel_version= os.listdir( "%s/lib/modules/" % install_root ) - except OSError, e: - return + initrd, kernel_version = getKernelVersion(vars, log) - if len(kernel_version) == 0: - return + # get the kernel version we are assuming + if kernel_version is None: + try: + kernel_version= os.listdir( "%s/lib/modules/" % SYSIMG_PATH ) + except OSError, e: + return - if len(kernel_version) > 1: - print( "WARNING: We may be returning modules for the wrong kernel." ) + if len(kernel_version) == 0: + return - kernel_version= kernel_version[0] + if len(kernel_version) > 1: + print( "WARNING: We may be returning modules for the wrong kernel." ) - print( "Using kernel version %s" % kernel_version ) + kernel_version= kernel_version[0] - # test to make sure the three files we need are present - pcitable_path = "%s/%s/pcitable" % (install_root,hwdatapath) - modules_pcimap_path = "%s/lib/modules/%s/modules.pcimap" % \ - (install_root,kernel_version) - modules_dep_path = "%s/lib/modules/%s/modules.dep" % \ - (install_root,kernel_version) + print( "Using kernel version %s" % kernel_version ) - for path in (pcitable_path,modules_pcimap_path,modules_dep_path): - if not os.access(path,os.R_OK): - print( "Unable to read %s" % path ) - return + # test to make sure the three files we need are present + pcitable_path = "%s/%s/pcitable" % (SYSIMG_PATH,hwdatapath) + modules_pcimap_path = "%s/lib/modules/%s/modules.pcimap" % \ + (SYSIMG_PATH,kernel_version) + modules_dep_path = "%s/lib/modules/%s/modules.dep" % \ + (SYSIMG_PATH,kernel_version) - # now, with those three files, merge them all into one easy to - # use lookup table - (all_pci_ids, all_modules) = merge_hw_tables.merge_files( modules_dep_path, - modules_pcimap_path, - pcitable_path ) - if all_modules is None: - print( "Unable to merge pci id tables." ) + for path in (pcitable_path,modules_pcimap_path,modules_dep_path): + if not os.access(path,os.R_OK): + print( "Unable to read %s" % path ) return - # this is the actual data structure we return - system_mods= {} + # now, with those three files, merge them all into one easy to + # use lookup table + (all_pci_ids, all_modules) = merge_hw_tables.merge_files( modules_dep_path, + modules_pcimap_path, + pcitable_path ) + if all_modules is None: + print( "Unable to merge pci id tables." ) + return + + # this is the actual data structure we return + system_mods= {} + + # these are the lists that will be in system_mods + network_mods= [] + scsi_mods= [] + + + # get all the system devices from lspci + lspci_prog= popen2.Popen3( LSPCI_CMD, 1 ) + if lspci_prog is None: + print( "Unable to run %s with popen2.Popen3" % LSPCI_CMD ) + return + + returncode= lspci_prog.wait() + if returncode != 0: + print( "Running %s failed" % LSPCI_CMD ) + return + else: + print( "Successfully ran %s" % LSPCI_CMD ) + + # for every lspci line, parse in the four tuple PCI id and the + # search for the corresponding driver from the dictionary + # generated by merge_hw_tables + for line in lspci_prog.fromchild: + # A sample line: + # + # 00:1f.1 "Class 0101" "8086" "2411" -r02 -p80 "8086" "2411" + # + # Remove '"', 'Class ', and anything beginning with '-' + # (usually revisions and prog-if flags) so that we can + # split on whitespace: + # + # 00:1f.1 0101 8086 2411 8086 2411 + # + line = line.strip() + line = line.replace('"', '') + line = line.replace('Class ', '') + line = re.sub('-[^ ]*', '', line) + + parts = line.split() + try: + if len(parts) < 4: + raise + classid = long(parts[1], 16) + vendorid = long(parts[2], 16) + deviceid = long(parts[3], 16) + except: + print "Invalid line:", line + continue + + if classid not in (PCI_CLASS_NETWORK_ETHERNET, + PCI_CLASS_STORAGE_SCSI, + PCI_CLASS_STORAGE_RAID, + PCI_CLASS_STORAGE_OTHER, + PCI_CLASS_STORAGE_IDE): + continue + + # Device may have a subvendorid and subdeviceid + try: + subvendorid = long(parts[4], 16) + subdeviceid = long(parts[5], 16) + except: + subvendorid = PCI_ANY + subdeviceid = PCI_ANY + + # search for driver that most closely matches the full_id + # to drivers that can handle any subvendor/subdevice + # version of the hardware. + full_ids = ((vendorid,deviceid,subvendorid,subdeviceid), + (vendorid,deviceid,subvendorid,PCI_ANY), + (vendorid,deviceid,PCI_ANY,PCI_ANY)) + + for full_id in full_ids: + module = all_pci_ids.get(full_id, None) + if module is not None: + if classid == PCI_CLASS_NETWORK_ETHERNET: + network_mods.append(module[0]) + elif classid in (PCI_CLASS_STORAGE_SCSI, + PCI_CLASS_STORAGE_RAID, + PCI_CLASS_STORAGE_OTHER, + PCI_CLASS_STORAGE_IDE): + scsi_mods.append(module[0]) + else: + print "not network or scsi: 0x%x" % classid + break - # these are the lists that will be in system_mods - network_mods= [] - scsi_mods= [] + system_mods[MODULE_CLASS_SCSI]= scsi_mods + system_mods[MODULE_CLASS_NETWORK]= network_mods + return system_mods - # get all the system devices from lspci - lspci_prog= popen2.Popen3( self.LSPCI_CMD, 1 ) - if lspci_prog is None: - print( "Unable to run %s with popen2.Popen3" % self.LSPCI_CMD ) - return - - returncode= lspci_prog.wait() - if returncode != 0: - print( "Running %s failed" % self.LSPCI_CMD ) - return - else: - print( "Successfully ran %s" % self.LSPCI_CMD ) - - # for every lspci line, parse in the four tuple PCI id and the - # search for the corresponding driver from the dictionary - # generated by merge_hw_tables - for line in lspci_prog.fromchild: - # A sample line: - # - # 00:1f.1 "Class 0101" "8086" "2411" -r02 -p80 "8086" "2411" - # - # Remove '"', 'Class ', and anything beginning with '-' - # (usually revisions and prog-if flags) so that we can - # split on whitespace: - # - # 00:1f.1 0101 8086 2411 8086 2411 - # - line = line.strip() - line = line.replace('"', '') - line = line.replace('Class ', '') - line = re.sub('-[^ ]*', '', line) - - parts = line.split() - try: - if len(parts) < 4: - raise - classid = long(parts[1], 16) - vendorid = long(parts[2], 16) - deviceid = long(parts[3], 16) - except: - print "Invalid line:", line - continue - - if classid not in (self.PCI_CLASS_NETWORK_ETHERNET, - self.PCI_CLASS_STORAGE_SCSI, - self.PCI_CLASS_STORAGE_RAID, - self.PCI_CLASS_STORAGE_OTHER, - self.PCI_CLASS_STORAGE_IDE): - continue - - # Device may have a subvendorid and subdeviceid - try: - subvendorid = long(parts[4], 16) - subdeviceid = long(parts[5], 16) - except: - subvendorid = self.PCI_ANY - subdeviceid = self.PCI_ANY - - # search for driver that most closely matches the full_id - # to drivers that can handle any subvendor/subdevice - # version of the hardware. - full_ids = ((vendorid,deviceid,subvendorid,subdeviceid), - (vendorid,deviceid,subvendorid,self.PCI_ANY), - (vendorid,deviceid,self.PCI_ANY,self.PCI_ANY)) - - for full_id in full_ids: - module = all_pci_ids.get(full_id, None) - if module is not None: - if classid == self.PCI_CLASS_NETWORK_ETHERNET: - network_mods.append(module[0]) - elif classid in (self.PCI_CLASS_STORAGE_SCSI, - self.PCI_CLASS_STORAGE_RAID, - self.PCI_CLASS_STORAGE_OTHER, - self.PCI_CLASS_STORAGE_IDE): - scsi_mods.append(module[0]) - else: - print "not network or scsi: 0x%x" % classid - break - - system_mods[self.MODULE_CLASS_SCSI]= scsi_mods - system_mods[self.MODULE_CLASS_NETWORK]= network_mods - - return system_mods +def getKernelVersion( vars = {} , log = sys.stderr): + # make sure we have the variables we need + try: + SYSIMG_PATH= vars["SYSIMG_PATH"] + if SYSIMG_PATH == "": + raise ValueError, "SYSIMG_PATH" - def remove_quotes( self, str ): - """ - remove double quotes off of a string if they exist - """ - if str == "" or str == None: - return str - if str[:1] == '"': - str= str[1:] - if str[len(str)-1] == '"': - str= str[:len(str)-1] - return str + NODE_MODEL_OPTIONS=vars["NODE_MODEL_OPTIONS"] + except KeyError, var: + raise BootManagerException, "Missing variable in vars: %s\n" % var + except ValueError, var: + raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var + option = '' + if NODE_MODEL_OPTIONS & ModelOptions.SMP: + option = 'smp' + try: + os.stat("%s/boot/kernel-boot%s" % (SYSIMG_PATH,option)) + os.stat("%s/boot/initrd-boot%s" % (SYSIMG_PATH,option)) + except OSError, e: + # smp kernel is not there; remove option from modeloptions + # such that the rest of the code base thinks we are just + # using the base kernel. + NODE_MODEL_OPTIONS = NODE_MODEL_OPTIONS & ~ModelOptions.SMP + vars["NODE_MODEL_OPTIONS"] = NODE_MODEL_OPTIONS + log.write( "WARNING: Couldn't locate smp kernel.\n") + option = '' + try: + initrd= os.readlink( "%s/boot/initrd-boot%s" % (SYSIMG_PATH,option) ) + kernel_version= initrd.replace("initrd-", "").replace(".img", "") + except OSError, e: + initrd = None + kernel_version = None + + return (initrd, kernel_version) if __name__ == "__main__": - info= systeminfo() - - devices= info.get_block_device_list() + devices= get_block_device_list() print "block devices detected:" if not devices: print "no devices found!" @@ -476,7 +422,7 @@ if __name__ == "__main__": print "" - memory= info.get_total_phsyical_mem() + memory= get_total_phsyical_mem() if not memory: print "unable to read /proc/meminfo for memory" else: @@ -485,21 +431,20 @@ if __name__ == "__main__": print "" - import sys kernel_version = None if len(sys.argv) > 2: kernel_version = sys.argv[1] - modules= info.get_system_modules("/",kernel_version) + modules= get_system_modules() if not modules: print "unable to list system modules" else: for type in modules: - if type == info.MODULE_CLASS_SCSI: + if type == MODULE_CLASS_SCSI: print( "all scsi modules:" ) for a_mod in modules[type]: print a_mod - elif type == info.MODULE_CLASS_NETWORK: + elif type == MODULE_CLASS_NETWORK: print( "all network modules:" ) for a_mod in modules[type]: print a_mod diff --git a/source/utils.py b/source/utils.py index 5da5fcd..9efea4d 100644 --- a/source/utils.py +++ b/source/utils.py @@ -1,44 +1,11 @@ +#!/usr/bin/python2 + # Copyright (c) 2003 Intel Corporation # All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF -# YOUR JURISDICTION. It is licensee's responsibility to comply with any -# export regulations applicable in licensee's jurisdiction. Under -# CURRENT (May 2000) U.S. export regulations this software is eligible -# for export from the U.S. and can be downloaded by or otherwise -# exported or reexported worldwide EXCEPT to U.S. embargoed destinations -# which include Cuba, Iraq, Libya, North Korea, Iran, Syria, Sudan, -# Afghanistan and any other country to which the U.S. has embargoed -# goods and services. - +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. +# expected /proc/partitions format import os, sys, shutil import popen2 diff --git a/support-files/BootLVM/desc b/support-files/BootLVM/desc deleted file mode 100644 index 8b2b466..0000000 --- a/support-files/BootLVM/desc +++ /dev/null @@ -1,3 +0,0 @@ -Contains vgscan, vgchange and the lvm library. -Just enough to load the root partion for booting -a node after its installed diff --git a/support-files/BootLVM/lib-paths b/support-files/BootLVM/lib-paths deleted file mode 100644 index fb602a3..0000000 --- a/support-files/BootLVM/lib-paths +++ /dev/null @@ -1,2 +0,0 @@ -/usr/lib -/lib diff --git a/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.list b/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.list deleted file mode 100644 index a8a3945..0000000 --- a/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.list +++ /dev/null @@ -1,9 +0,0 @@ -/lib/liblvm-10.so -/lib/liblvm-10.so.1 -/lib/liblvm-10.so.1.0 -/sbin/vgchange -/sbin/vgscan -/sbin/vgmknodes -/sbin/vgextend -/sbin/lvextend -/sbin/pvdisplay diff --git a/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.rpm b/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.rpm deleted file mode 100644 index 2c91b59..0000000 Binary files a/support-files/BootLVM/source-rpms/lvm-1.0.3-4.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/custom.sh b/support-files/BootstrapRPM/custom.sh deleted file mode 100755 index ee85b3d..0000000 --- a/support-files/BootstrapRPM/custom.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# make sure the yum rpm is in extra-rpms/stage3rpms -if [ ! -e extra-rpms/stage3rpms/yum-*planetlab.noarch.rpm ]; then - echo "yum RPM doesn't exist in extra-rpms/stage3rpms/" - echo "see extra-rpms/stage3rpms/README_EXTERNAL_RPMS." - exit 1 -fi - -# make sure the pycurl rpm is in extra-rpms/stage3rpms -if [ ! -e extra-rpms/stage3rpms/pycurl-*.i386.rpm ]; then - echo "pycurl RPM doesn't exist in extra-rpms/stage3rpms/" - echo "see extra-rpms/stage3rpms/README_EXTERNAL_RPMS." - exit 1 -fi - -echo "Adding all extra rpms to extract directory..." -cp -vr extra-rpms/* rpm-extract/ - -for i in `ls extra-rpms/`; do - echo $i >> keep-files -done - -exit 0 - diff --git a/support-files/BootstrapRPM/desc b/support-files/BootstrapRPM/desc deleted file mode 100644 index cfce58d..0000000 --- a/support-files/BootstrapRPM/desc +++ /dev/null @@ -1 +0,0 @@ -Contains all the files necessary to run RPM diff --git a/support-files/BootstrapRPM/extra-rpms/stage1rpms/basesystem-8.0-2.noarch.rpm b/support-files/BootstrapRPM/extra-rpms/stage1rpms/basesystem-8.0-2.noarch.rpm deleted file mode 100644 index 341d44a..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage1rpms/basesystem-8.0-2.noarch.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage1rpms/filesystem-2.2.1-3.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage1rpms/filesystem-2.2.1-3.i386.rpm deleted file mode 100644 index 196d275..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage1rpms/filesystem-2.2.1-3.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage1rpms/setup-2.5.25-1.noarch.rpm b/support-files/BootstrapRPM/extra-rpms/stage1rpms/setup-2.5.25-1.noarch.rpm deleted file mode 100644 index 0b169bf..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage1rpms/setup-2.5.25-1.noarch.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/SysVinit-2.84-13.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/SysVinit-2.84-13.i386.rpm deleted file mode 100644 index 9502728..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/SysVinit-2.84-13.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/bash-2.05b-20.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/bash-2.05b-20.i386.rpm deleted file mode 100644 index ab1e659..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/bash-2.05b-20.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/bzip2-libs-1.0.2-8.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/bzip2-libs-1.0.2-8.i386.rpm deleted file mode 100644 index d1bf7c4..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/bzip2-libs-1.0.2-8.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/chkconfig-1.3.8-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/chkconfig-1.3.8-1.i386.rpm deleted file mode 100644 index c8435b2..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/chkconfig-1.3.8-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/coreutils-4.5.3-19.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/coreutils-4.5.3-19.i386.rpm deleted file mode 100644 index 0adc54c..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/coreutils-4.5.3-19.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-2.7-21.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-2.7-21.i386.rpm deleted file mode 100644 index a22f0b7..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-2.7-21.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-dicts-2.7-21.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-dicts-2.7-21.i386.rpm deleted file mode 100644 index 560cd8b..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/cracklib-dicts-2.7-21.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/db4-4.0.14-20.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/db4-4.0.14-20.i386.rpm deleted file mode 100644 index 974a69c..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/db4-4.0.14-20.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/dev-3.3.2-5.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/dev-3.3.2-5.i386.rpm deleted file mode 100644 index bd5b01e..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/dev-3.3.2-5.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/e2fsprogs-1.32-6.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/e2fsprogs-1.32-6.i386.rpm deleted file mode 100644 index d606430..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/e2fsprogs-1.32-6.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-0.76-3.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-0.76-3.i386.rpm deleted file mode 100644 index 8615d4d..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-0.76-3.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-libelf-0.76-3.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-libelf-0.76-3.i386.rpm deleted file mode 100644 index 50dbf08..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/elfutils-libelf-0.76-3.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/expat-1.95.5-2.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/expat-1.95.5-2.i386.rpm deleted file mode 100644 index fc456ea..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/expat-1.95.5-2.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/findutils-4.1.7-9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/findutils-4.1.7-9.i386.rpm deleted file mode 100644 index dd030b9..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/findutils-4.1.7-9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gawk-3.1.1-9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/gawk-3.1.1-9.i386.rpm deleted file mode 100644 index b2abc64..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gawk-3.1.1-9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gdbm-1.8.0-20.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/gdbm-1.8.0-20.i386.rpm deleted file mode 100644 index 9848616..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gdbm-1.8.0-20.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glib-1.2.10-10.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/glib-1.2.10-10.i386.rpm deleted file mode 100644 index 919d4de..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glib-1.2.10-10.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-2.3.2-11.9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-2.3.2-11.9.i386.rpm deleted file mode 100644 index 974e34d..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-2.3.2-11.9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-common-2.3.2-11.9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-common-2.3.2-11.9.i386.rpm deleted file mode 100644 index 689462b..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/glibc-common-2.3.2-11.9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gmp-4.1.2-2.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/gmp-4.1.2-2.i386.rpm deleted file mode 100644 index 24c3460..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/gmp-4.1.2-2.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/grep-2.5.1-7.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/grep-2.5.1-7.i386.rpm deleted file mode 100644 index d705f31..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/grep-2.5.1-7.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/info-4.3-5.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/info-4.3-5.i386.rpm deleted file mode 100644 index 0dee92f..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/info-4.3-5.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/initscripts-7.14-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/initscripts-7.14-1.i386.rpm deleted file mode 100644 index fa753cb..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/initscripts-7.14-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/iproute-2.4.7-7.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/iproute-2.4.7-7.i386.rpm deleted file mode 100644 index 6ce8aa4..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/iproute-2.4.7-7.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/iputils-20020927-2.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/iputils-20020927-2.i386.rpm deleted file mode 100644 index dc29444..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/iputils-20020927-2.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-devel-1.2.7-10.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-devel-1.2.7-10.i386.rpm deleted file mode 100644 index de88946..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-devel-1.2.7-10.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-libs-1.2.7-10.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-libs-1.2.7-10.i386.rpm deleted file mode 100644 index 183a5ee..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/krb5-libs-1.2.7-10.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libtermcap-2.0.8-35.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/libtermcap-2.0.8-35.i386.rpm deleted file mode 100644 index d8bc070..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libtermcap-2.0.8-35.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-2.5.4-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-2.5.4-1.i386.rpm deleted file mode 100644 index 839e6ff..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-2.5.4-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-python-2.5.4-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-python-2.5.4-1.i386.rpm deleted file mode 100644 index aabc97f..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/libxml2-python-2.5.4-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mingetty-1.01-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/mingetty-1.01-1.i386.rpm deleted file mode 100644 index ecbc4a9..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mingetty-1.01-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mktemp-1.5-18.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/mktemp-1.5-18.i386.rpm deleted file mode 100644 index e89acd1..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mktemp-1.5-18.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/modutils-2.4.22-8.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/modutils-2.4.22-8.i386.rpm deleted file mode 100644 index 369d652..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/modutils-2.4.22-8.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mount-2.11y-9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/mount-2.11y-9.i386.rpm deleted file mode 100644 index 4147014..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/mount-2.11y-9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/ncurses-5.3-4.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/ncurses-5.3-4.i386.rpm deleted file mode 100644 index b41a2db..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/ncurses-5.3-4.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/net-tools-1.60-12.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/net-tools-1.60-12.i386.rpm deleted file mode 100644 index f4c69e3..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/net-tools-1.60-12.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-0.9.7a-2.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-0.9.7a-2.i386.rpm deleted file mode 100644 index 7889856..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-0.9.7a-2.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-devel-0.9.7a-2.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-devel-0.9.7a-2.i386.rpm deleted file mode 100644 index d11ee55..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/openssl-devel-0.9.7a-2.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/pam-0.75-48.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/pam-0.75-48.i386.rpm deleted file mode 100644 index e683687..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/pam-0.75-48.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/pcre-3.9-10.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/pcre-3.9-10.i386.rpm deleted file mode 100644 index ace1494..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/pcre-3.9-10.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/popt-1.8-0.69.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/popt-1.8-0.69.i386.rpm deleted file mode 100644 index d34b5da..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/popt-1.8-0.69.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/procps-2.0.11-6.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/procps-2.0.11-6.i386.rpm deleted file mode 100644 index 0da84c3..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/procps-2.0.11-6.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/psmisc-21.2-4.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/psmisc-21.2-4.i386.rpm deleted file mode 100644 index ee117e5..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/psmisc-21.2-4.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/python-2.2.2-26.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/python-2.2.2-26.i386.rpm deleted file mode 100644 index aba3c18..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/python-2.2.2-26.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/readline-4.3-5.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/readline-4.3-5.i386.rpm deleted file mode 100644 index 2a35e65..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/readline-4.3-5.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/redhat-release-9-3.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/redhat-release-9-3.i386.rpm deleted file mode 100644 index 342d058..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/redhat-release-9-3.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/sed-4.0.5-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/sed-4.0.5-1.i386.rpm deleted file mode 100644 index 7a4e45b..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/sed-4.0.5-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/shadow-utils-4.0.3-6.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/shadow-utils-4.0.3-6.i386.rpm deleted file mode 100644 index bf9b00d..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/shadow-utils-4.0.3-6.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/sysklogd-1.4.1-12.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/sysklogd-1.4.1-12.i386.rpm deleted file mode 100644 index 21eedda..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/sysklogd-1.4.1-12.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/termcap-11.0.1-16.noarch.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/termcap-11.0.1-16.noarch.rpm deleted file mode 100644 index 31a00bd..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/termcap-11.0.1-16.noarch.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/util-linux-2.11y-9.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/util-linux-2.11y-9.i386.rpm deleted file mode 100644 index 53a2cd6..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/util-linux-2.11y-9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/which-2.14-5.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/which-2.14-5.i386.rpm deleted file mode 100644 index 858ed4f..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/which-2.14-5.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/words-2-21.noarch.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/words-2-21.noarch.rpm deleted file mode 100644 index 2d74c74..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/words-2-21.noarch.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage2rpms/zlib-1.1.4-8.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage2rpms/zlib-1.1.4-8.i386.rpm deleted file mode 100644 index b13bbaa..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage2rpms/zlib-1.1.4-8.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-7.10.6-7.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-7.10.6-7.i386.rpm deleted file mode 100644 index a3e73f3..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-7.10.6-7.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-devel-7.10.6-7.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-devel-7.10.6-7.i386.rpm deleted file mode 100644 index 6da913d..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/curl-devel-7.10.6-7.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/pycurl-7.10.4-3.planetlab.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/pycurl-7.10.4-3.planetlab.i386.rpm deleted file mode 100644 index 1eded34..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/pycurl-7.10.4-3.planetlab.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-4.2-1.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-4.2-1.i386.rpm deleted file mode 100644 index 782e54b..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-4.2-1.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-python-4.2-0.69.i386.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-python-4.2-0.69.i386.rpm deleted file mode 100644 index 8c9a19e..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/rpm-python-4.2-0.69.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/extra-rpms/stage3rpms/yum-2.0.7-3.planetlab.noarch.rpm b/support-files/BootstrapRPM/extra-rpms/stage3rpms/yum-2.0.7-3.planetlab.noarch.rpm deleted file mode 100644 index d8294a0..0000000 Binary files a/support-files/BootstrapRPM/extra-rpms/stage3rpms/yum-2.0.7-3.planetlab.noarch.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.list b/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.list deleted file mode 100644 index d170f2e..0000000 --- a/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.list +++ /dev/null @@ -1,2 +0,0 @@ -/usr/lib/libbz2.so.1 -/usr/lib/libbz2.so.1.0.2 diff --git a/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.rpm b/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.rpm deleted file mode 100644 index d1bf7c4..0000000 Binary files a/support-files/BootstrapRPM/source-rpms/bzip2-libs-1.0.2-8.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.list b/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.list deleted file mode 100644 index 3730c5f..0000000 --- a/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.list +++ /dev/null @@ -1,2 +0,0 @@ -/usr/lib/libelf-0.76.so -/usr/lib/libelf.so.1 diff --git a/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.rpm b/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.rpm deleted file mode 100644 index 50dbf08..0000000 Binary files a/support-files/BootstrapRPM/source-rpms/elfutils-libelf-0.76-3.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.list b/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.list deleted file mode 100644 index 82a9cf5..0000000 --- a/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.list +++ /dev/null @@ -1,236 +0,0 @@ -/etc/ld.so.conf -/etc/localtime -/etc/nsswitch.conf -/etc/rpc -/lib/ld-2.3.2.so -/lib/ld-linux.so.2 -/lib/libBrokenLocale-2.3.2.so -/lib/libBrokenLocale.so.1 -/lib/libSegFault.so -/lib/libanl-2.3.2.so -/lib/libanl.so.1 -/lib/libc-2.3.2.so -/lib/libc.so.6 -/lib/libcrypt-2.3.2.so -/lib/libcrypt.so.1 -/lib/libdl-2.3.2.so -/lib/libdl.so.2 -/lib/libm-2.3.2.so -/lib/libm.so.6 -/lib/libnsl-2.3.2.so -/lib/libnsl.so.1 -/lib/libnss_compat-2.3.2.so -/lib/libnss_compat.so.2 -/lib/libnss_dns-2.3.2.so -/lib/libnss_dns.so.2 -/lib/libnss_files-2.3.2.so -/lib/libnss_files.so.2 -/lib/libnss_hesiod-2.3.2.so -/lib/libnss_hesiod.so.2 -/lib/libnss_nis-2.3.2.so -/lib/libnss_nis.so.2 -/lib/libnss_nisplus-2.3.2.so -/lib/libnss_nisplus.so.2 -/lib/libpthread-0.10.so -/lib/libpthread.so.0 -/lib/libresolv-2.3.2.so -/lib/libresolv.so.2 -/lib/librt-2.3.2.so -/lib/librt.so.1 -/lib/libthread_db-1.0.so -/lib/libthread_db.so.1 -/lib/libutil-2.3.2.so -/lib/libutil.so.1 -/sbin/ldconfig -/sbin/sln -/usr/lib/gconv/ANSI_X3.110.so -/usr/lib/gconv/ARMSCII-8.so -/usr/lib/gconv/ASMO_449.so -/usr/lib/gconv/BIG5.so -/usr/lib/gconv/BIG5HKSCS.so -/usr/lib/gconv/CP10007.so -/usr/lib/gconv/CP1125.so -/usr/lib/gconv/CP1250.so -/usr/lib/gconv/CP1251.so -/usr/lib/gconv/CP1252.so -/usr/lib/gconv/CP1253.so -/usr/lib/gconv/CP1254.so -/usr/lib/gconv/CP1255.so -/usr/lib/gconv/CP1256.so -/usr/lib/gconv/CP1257.so -/usr/lib/gconv/CP1258.so -/usr/lib/gconv/CP737.so -/usr/lib/gconv/CP775.so -/usr/lib/gconv/CSN_369103.so -/usr/lib/gconv/CWI.so -/usr/lib/gconv/DEC-MCS.so -/usr/lib/gconv/EBCDIC-AT-DE-A.so -/usr/lib/gconv/EBCDIC-AT-DE.so -/usr/lib/gconv/EBCDIC-CA-FR.so -/usr/lib/gconv/EBCDIC-DK-NO-A.so -/usr/lib/gconv/EBCDIC-DK-NO.so -/usr/lib/gconv/EBCDIC-ES-A.so -/usr/lib/gconv/EBCDIC-ES-S.so -/usr/lib/gconv/EBCDIC-ES.so -/usr/lib/gconv/EBCDIC-FI-SE-A.so -/usr/lib/gconv/EBCDIC-FI-SE.so -/usr/lib/gconv/EBCDIC-FR.so -/usr/lib/gconv/EBCDIC-IS-FRISS.so -/usr/lib/gconv/EBCDIC-IT.so -/usr/lib/gconv/EBCDIC-PT.so -/usr/lib/gconv/EBCDIC-UK.so -/usr/lib/gconv/EBCDIC-US.so -/usr/lib/gconv/ECMA-CYRILLIC.so -/usr/lib/gconv/EUC-CN.so -/usr/lib/gconv/EUC-JISX0213.so -/usr/lib/gconv/EUC-JP.so -/usr/lib/gconv/EUC-KR.so -/usr/lib/gconv/EUC-TW.so -/usr/lib/gconv/GB18030.so -/usr/lib/gconv/GBBIG5.so -/usr/lib/gconv/GBGBK.so -/usr/lib/gconv/GBK.so -/usr/lib/gconv/GEORGIAN-ACADEMY.so -/usr/lib/gconv/GEORGIAN-PS.so -/usr/lib/gconv/GOST_19768-74.so -/usr/lib/gconv/GREEK-CCITT.so -/usr/lib/gconv/GREEK7-OLD.so -/usr/lib/gconv/GREEK7.so -/usr/lib/gconv/HP-ROMAN8.so -/usr/lib/gconv/IBM037.so -/usr/lib/gconv/IBM038.so -/usr/lib/gconv/IBM1004.so -/usr/lib/gconv/IBM1026.so -/usr/lib/gconv/IBM1046.so -/usr/lib/gconv/IBM1047.so -/usr/lib/gconv/IBM1124.so -/usr/lib/gconv/IBM1129.so -/usr/lib/gconv/IBM1132.so -/usr/lib/gconv/IBM1133.so -/usr/lib/gconv/IBM1160.so -/usr/lib/gconv/IBM1161.so -/usr/lib/gconv/IBM1162.so -/usr/lib/gconv/IBM1163.so -/usr/lib/gconv/IBM1164.so -/usr/lib/gconv/IBM256.so -/usr/lib/gconv/IBM273.so -/usr/lib/gconv/IBM274.so -/usr/lib/gconv/IBM275.so -/usr/lib/gconv/IBM277.so -/usr/lib/gconv/IBM278.so -/usr/lib/gconv/IBM280.so -/usr/lib/gconv/IBM281.so -/usr/lib/gconv/IBM284.so -/usr/lib/gconv/IBM285.so -/usr/lib/gconv/IBM290.so -/usr/lib/gconv/IBM297.so -/usr/lib/gconv/IBM420.so -/usr/lib/gconv/IBM423.so -/usr/lib/gconv/IBM424.so -/usr/lib/gconv/IBM437.so -/usr/lib/gconv/IBM500.so -/usr/lib/gconv/IBM850.so -/usr/lib/gconv/IBM851.so -/usr/lib/gconv/IBM852.so -/usr/lib/gconv/IBM855.so -/usr/lib/gconv/IBM856.so -/usr/lib/gconv/IBM857.so -/usr/lib/gconv/IBM860.so -/usr/lib/gconv/IBM861.so -/usr/lib/gconv/IBM862.so -/usr/lib/gconv/IBM863.so -/usr/lib/gconv/IBM864.so -/usr/lib/gconv/IBM865.so -/usr/lib/gconv/IBM866.so -/usr/lib/gconv/IBM866NAV.so -/usr/lib/gconv/IBM868.so -/usr/lib/gconv/IBM869.so -/usr/lib/gconv/IBM870.so -/usr/lib/gconv/IBM871.so -/usr/lib/gconv/IBM874.so -/usr/lib/gconv/IBM875.so -/usr/lib/gconv/IBM880.so -/usr/lib/gconv/IBM891.so -/usr/lib/gconv/IBM903.so -/usr/lib/gconv/IBM904.so -/usr/lib/gconv/IBM905.so -/usr/lib/gconv/IBM918.so -/usr/lib/gconv/IBM922.so -/usr/lib/gconv/IBM930.so -/usr/lib/gconv/IBM932.so -/usr/lib/gconv/IBM933.so -/usr/lib/gconv/IBM935.so -/usr/lib/gconv/IBM937.so -/usr/lib/gconv/IBM939.so -/usr/lib/gconv/IBM943.so -/usr/lib/gconv/IEC_P27-1.so -/usr/lib/gconv/INIS-8.so -/usr/lib/gconv/INIS-CYRILLIC.so -/usr/lib/gconv/INIS.so -/usr/lib/gconv/ISIRI-3342.so -/usr/lib/gconv/ISO-2022-CN-EXT.so -/usr/lib/gconv/ISO-2022-CN.so -/usr/lib/gconv/ISO-2022-JP-3.so -/usr/lib/gconv/ISO-2022-JP.so -/usr/lib/gconv/ISO-2022-KR.so -/usr/lib/gconv/ISO-IR-197.so -/usr/lib/gconv/ISO-IR-209.so -/usr/lib/gconv/ISO646.so -/usr/lib/gconv/ISO8859-1.so -/usr/lib/gconv/ISO8859-10.so -/usr/lib/gconv/ISO8859-11.so -/usr/lib/gconv/ISO8859-13.so -/usr/lib/gconv/ISO8859-14.so -/usr/lib/gconv/ISO8859-15.so -/usr/lib/gconv/ISO8859-16.so -/usr/lib/gconv/ISO8859-2.so -/usr/lib/gconv/ISO8859-3.so -/usr/lib/gconv/ISO8859-4.so -/usr/lib/gconv/ISO8859-5.so -/usr/lib/gconv/ISO8859-6.so -/usr/lib/gconv/ISO8859-7.so -/usr/lib/gconv/ISO8859-8.so -/usr/lib/gconv/ISO8859-9.so -/usr/lib/gconv/ISO_10367-BOX.so -/usr/lib/gconv/ISO_2033.so -/usr/lib/gconv/ISO_5427-EXT.so -/usr/lib/gconv/ISO_5427.so -/usr/lib/gconv/ISO_5428.so -/usr/lib/gconv/ISO_6937-2.so -/usr/lib/gconv/ISO_6937.so -/usr/lib/gconv/JOHAB.so -/usr/lib/gconv/KOI-8.so -/usr/lib/gconv/KOI8-R.so -/usr/lib/gconv/KOI8-T.so -/usr/lib/gconv/KOI8-U.so -/usr/lib/gconv/LATIN-GREEK-1.so -/usr/lib/gconv/LATIN-GREEK.so -/usr/lib/gconv/MAC-IS.so -/usr/lib/gconv/MAC-SAMI.so -/usr/lib/gconv/MAC-UK.so -/usr/lib/gconv/MACINTOSH.so -/usr/lib/gconv/NATS-DANO.so -/usr/lib/gconv/NATS-SEFI.so -/usr/lib/gconv/SAMI-WS2.so -/usr/lib/gconv/SHIFT_JISX0213.so -/usr/lib/gconv/SJIS.so -/usr/lib/gconv/T.61.so -/usr/lib/gconv/TCVN5712-1.so -/usr/lib/gconv/TIS-620.so -/usr/lib/gconv/TSCII.so -/usr/lib/gconv/UHC.so -/usr/lib/gconv/UNICODE.so -/usr/lib/gconv/UTF-16.so -/usr/lib/gconv/UTF-32.so -/usr/lib/gconv/UTF-7.so -/usr/lib/gconv/VISCII.so -/usr/lib/gconv/gconv-modules -/usr/lib/gconv/gconv-modules.cache -/usr/lib/gconv/libCNS.so -/usr/lib/gconv/libGB.so -/usr/lib/gconv/libISOIR165.so -/usr/lib/gconv/libJIS.so -/usr/lib/gconv/libJISX0213.so -/usr/lib/gconv/libKSC.so -/usr/sbin/glibc_post_upgrade -/usr/sbin/iconvconfig diff --git a/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.rpm b/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.rpm deleted file mode 100644 index 974e34d..0000000 Binary files a/support-files/BootstrapRPM/source-rpms/glibc-2.3.2-11.9.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.list b/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.list deleted file mode 100644 index 645f836..0000000 --- a/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.list +++ /dev/null @@ -1,35 +0,0 @@ -/usr/include/popt.h -/usr/lib/libpopt.a -/usr/lib/libpopt.la -/usr/lib/libpopt.so -/usr/lib/libpopt.so.0 -/usr/lib/libpopt.so.0.0.0 -/usr/share/locale/cs/LC_MESSAGES/popt.mo -/usr/share/locale/da/LC_MESSAGES/popt.mo -/usr/share/locale/de/LC_MESSAGES/popt.mo -/usr/share/locale/es/LC_MESSAGES/popt.mo -/usr/share/locale/eu_ES/LC_MESSAGES/popt.mo -/usr/share/locale/fi/LC_MESSAGES/popt.mo -/usr/share/locale/fr/LC_MESSAGES/popt.mo -/usr/share/locale/gl/LC_MESSAGES/popt.mo -/usr/share/locale/hu/LC_MESSAGES/popt.mo -/usr/share/locale/id/LC_MESSAGES/popt.mo -/usr/share/locale/is/LC_MESSAGES/popt.mo -/usr/share/locale/it/LC_MESSAGES/popt.mo -/usr/share/locale/ja/LC_MESSAGES/popt.mo -/usr/share/locale/ko/LC_MESSAGES/popt.mo -/usr/share/locale/no/LC_MESSAGES/popt.mo -/usr/share/locale/pl/LC_MESSAGES/popt.mo -/usr/share/locale/pt/LC_MESSAGES/popt.mo -/usr/share/locale/pt_BR/LC_MESSAGES/popt.mo -/usr/share/locale/ro/LC_MESSAGES/popt.mo -/usr/share/locale/ru/LC_MESSAGES/popt.mo -/usr/share/locale/sk/LC_MESSAGES/popt.mo -/usr/share/locale/sl/LC_MESSAGES/popt.mo -/usr/share/locale/sr/LC_MESSAGES/popt.mo -/usr/share/locale/sv/LC_MESSAGES/popt.mo -/usr/share/locale/tr/LC_MESSAGES/popt.mo -/usr/share/locale/uk/LC_MESSAGES/popt.mo -/usr/share/locale/wa/LC_MESSAGES/popt.mo -/usr/share/locale/zh/LC_MESSAGES/popt.mo -/usr/share/locale/zh_CN.GB2312/LC_MESSAGES/popt.mo diff --git a/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.rpm b/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.rpm deleted file mode 100644 index d34b5da..0000000 Binary files a/support-files/BootstrapRPM/source-rpms/popt-1.8-0.69.i386.rpm and /dev/null differ diff --git a/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.list b/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.list deleted file mode 100644 index ffc446b..0000000 --- a/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.list +++ /dev/null @@ -1,66 +0,0 @@ -/bin/rpm -/etc/rpm -/usr/bin/gendiff -/usr/bin/rpm2cpio -/usr/bin/rpmdb -/usr/bin/rpmquery -/usr/bin/rpmsign -/usr/bin/rpmverify -/usr/lib/librpm-4.2.so -/usr/lib/librpmbuild-4.2.so -/usr/lib/librpmdb-4.2.so -/usr/lib/librpmio-4.2.so -/usr/lib/rpm -/usr/lib/rpm/athlon-linux -/usr/lib/rpm/athlon-linux/macros -/usr/lib/rpm/config.guess -/usr/lib/rpm/config.sub -/usr/lib/rpm/convertrpmrc.sh -/usr/lib/rpm/i386-linux -/usr/lib/rpm/i386-linux/macros -/usr/lib/rpm/i486-linux -/usr/lib/rpm/i486-linux/macros -/usr/lib/rpm/i586-linux -/usr/lib/rpm/i586-linux/macros -/usr/lib/rpm/i686-linux -/usr/lib/rpm/i686-linux/macros -/usr/lib/rpm/macros -/usr/lib/rpm/mkinstalldirs -/usr/lib/rpm/noarch-linux -/usr/lib/rpm/noarch-linux/macros -/usr/lib/rpm/rpm.daily -/usr/lib/rpm/rpm.log -/usr/lib/rpm/rpm.xinetd -/usr/lib/rpm/rpm2cpio.sh -/usr/lib/rpm/rpmd -/usr/lib/rpm/rpme -/usr/lib/rpm/rpmi -/usr/lib/rpm/rpmk -/usr/lib/rpm/rpmpopt-4.2 -/usr/lib/rpm/rpmq -/usr/lib/rpm/rpmrc -/usr/lib/rpm/rpmu -/usr/lib/rpm/rpmv -/usr/lib/rpm/tgpg -/usr/share/locale/cs/LC_MESSAGES/rpm.mo -/usr/share/locale/da/LC_MESSAGES/rpm.mo -/usr/share/locale/de/LC_MESSAGES/rpm.mo -/usr/share/locale/fi/LC_MESSAGES/rpm.mo -/usr/share/locale/fr/LC_MESSAGES/rpm.mo -/usr/share/locale/gl/LC_MESSAGES/rpm.mo -/usr/share/locale/is/LC_MESSAGES/rpm.mo -/usr/share/locale/ja/LC_MESSAGES/rpm.mo -/usr/share/locale/ko/LC_MESSAGES/rpm.mo -/usr/share/locale/no/LC_MESSAGES/rpm.mo -/usr/share/locale/pl/LC_MESSAGES/rpm.mo -/usr/share/locale/pt/LC_MESSAGES/rpm.mo -/usr/share/locale/pt_BR/LC_MESSAGES/rpm.mo -/usr/share/locale/ro/LC_MESSAGES/rpm.mo -/usr/share/locale/ru/LC_MESSAGES/rpm.mo -/usr/share/locale/sk/LC_MESSAGES/rpm.mo -/usr/share/locale/sl/LC_MESSAGES/rpm.mo -/usr/share/locale/sr/LC_MESSAGES/rpm.mo -/usr/share/locale/sv/LC_MESSAGES/rpm.mo -/usr/share/locale/tr/LC_MESSAGES/rpm.mo -/var/lib/rpm -/var/spool/repackage diff --git a/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.rpm b/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.rpm deleted file mode 100644 index 782e54b..0000000 Binary files a/support-files/BootstrapRPM/source-rpms/rpm-4.2-1.i386.rpm and /dev/null differ diff --git a/support-files/Makefile b/support-files/Makefile index 1d9e99e..43d6c3e 100644 --- a/support-files/Makefile +++ b/support-files/Makefile @@ -7,23 +7,13 @@ # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id: Makefile,v 1.2 2005/09/02 19:09:33 mlhuang Exp $ +# $Id: Makefile,v 1.4 2006/08/20 21:21:13 thierry Exp $ # -all: alpina-BootLVM.tar.gz alpina-PartDisks.tar.gz PlanetLab-Bootstrap.tar.bz2 - -alpina-BootLVM.tar.gz: - ./buildsupport.sh build BootLVM - -alpina-BootstrapRPM.tar.gz: - ./buildsupport.sh build BootstrapRPM - -alpina-PartDisks.tar.gz: - ./buildsupport.sh build PartDisks +all: PlanetLab-Bootstrap.tar.bz2 PlanetLab-Bootstrap.tar.bz2: ./buildnode.sh clean: - ./buildsupport.sh clean rm -f PlanetLab-Bootstrap.tar.bz2 diff --git a/support-files/PartDisks/custom.sh b/support-files/PartDisks/custom.sh deleted file mode 100755 index b006fe6..0000000 --- a/support-files/PartDisks/custom.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -echo "Adding special files:" -cp lib-paths rpm-extract - -echo "lib-paths" >> keep-files - -exit 0 diff --git a/support-files/PartDisks/desc b/support-files/PartDisks/desc deleted file mode 100644 index bf3bea8..0000000 --- a/support-files/PartDisks/desc +++ /dev/null @@ -1,3 +0,0 @@ -stage 1 is everything need to get the disks online, mounted, and -the new swap turned on (so we can create a larger tempfs for -later stages) diff --git a/support-files/PartDisks/lib-paths b/support-files/PartDisks/lib-paths deleted file mode 100644 index fb602a3..0000000 --- a/support-files/PartDisks/lib-paths +++ /dev/null @@ -1,2 +0,0 @@ -/usr/lib -/lib diff --git a/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.list b/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.list deleted file mode 100644 index 74b338b..0000000 --- a/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.list +++ /dev/null @@ -1,42 +0,0 @@ -/lib/liblvm-10.so -/lib/liblvm-10.so.1 -/lib/liblvm-10.so.1.0 -/sbin/e2fsadm -/sbin/lvchange -/sbin/lvcreate -/sbin/lvdisplay -/sbin/lvextend -/sbin/lvmchange -/sbin/lvmcreate_initrd -/sbin/lvmdiskscan -/sbin/lvmsadc -/sbin/lvmsar -/sbin/lvreduce -/sbin/lvremove -/sbin/lvrename -/sbin/lvscan -/sbin/pvchange -/sbin/pvcreate -/sbin/pvdata -/sbin/pvdisplay -/sbin/pvmove -/sbin/pvscan -/sbin/vgcfgbackup -/sbin/vgcfgrestore -/sbin/vgchange -/sbin/vgck -/sbin/vgcreate -/sbin/vgdisplay -/sbin/vgexport -/sbin/vgextend -/sbin/vgimport -/sbin/vgmerge -/sbin/vgmknodes -/sbin/vgreduce -/sbin/vgremove -/sbin/vgrename -/sbin/vgscan -/sbin/vgsplit -/sbin/vgchange.static -/sbin/vgscan.static -/sbin/vgwrapper diff --git a/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.rpm b/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.rpm deleted file mode 100644 index 2c91b59..0000000 Binary files a/support-files/PartDisks/source-rpms/lvm-1.0.3-4.i386.rpm and /dev/null differ diff --git a/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.list b/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.list deleted file mode 100644 index 34b1e6b..0000000 --- a/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.list +++ /dev/null @@ -1,3 +0,0 @@ -/usr/lib/libparted-1.4.so.14 -/usr/lib/libparted-1.4.so.14.3.7 -/usr/lib/python2.2/site-packages/partedmodule.so diff --git a/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.rpm b/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.rpm deleted file mode 100644 index 7784ae3..0000000 Binary files a/support-files/PartDisks/source-rpms/parted-1.4.24-6.i386.rpm and /dev/null differ diff --git a/support-files/buildnode.sh b/support-files/buildnode.sh index 0bbc6ea..3a36962 100755 --- a/support-files/buildnode.sh +++ b/support-files/buildnode.sh @@ -6,7 +6,7 @@ # Mark Huang # Copyright (C) 2005-2006 The Trustees of Princeton University # -# $Id: buildnode.sh,v 1.10 2006/04/11 22:13:18 mlhuang Exp $ +# $Id: buildnode.sh,v 1.12 2006/08/11 13:04:03 thierry Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -73,7 +73,7 @@ export PL_BOOTCD=1 # because groupinstall does not honor Requires(pre) dependencies # properly, most %pre scripts require coreutils to be installed first, # and some of our %post scripts require python. -mkfedora -v -r $releasever -a $basearch -k -p dev -p coreutils -p python -g PlanetLab $VROOT +mkfedora -v -r $releasever -a $basearch -k -p udev -p coreutils -p python -g PlanetLab $VROOT # Disable unnecessary services echo "* Disabling unnecessary services" diff --git a/support-files/buildsupport.sh b/support-files/buildsupport.sh deleted file mode 100755 index b987d7c..0000000 --- a/support-files/buildsupport.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash - -# for each file in support-rpms/*.list, extract the rpm and -# keep the files from the list - -# list of stage tar ball we need to build, this is basically -# the list of stage directories -ALL_STAGES='PartDisks BootstrapRPM BootLVM' - -# new files, in each stage dir -RPM_EXTRACT_DIR='rpm-extract/' -KEEP_FILE_LIST='keep-files' - -# source files, in each stage dir -SOURCE_RPM_DIR='source-rpms/' -EXTRA_FILES='lib-paths' -CUSTOM_SCRIPT='custom.sh' - -# destination for upload command -DEST_USER='root' -DEST_SERVER='yankee.cs.princeton.edu' -DEST_PATH='/export0/echo/alpina/' - - -build() -{ - BUILD_STAGE=$1 - - for STAGE_DIR in $BUILD_STAGE; do - - echo "Building $STAGE_DIR" - cd $STAGE_DIR - - STAGE_DEST_FILE="alpina-$STAGE_DIR.tar.gz" - - for file in `ls $SOURCE_RPM_DIR/*.list`; do - RPM_NAME="`basename $file list`rpm" - RPM_FILE="$SOURCE_RPM_DIR/$RPM_NAME" - - echo - echo "Extracting $RPM_NAME:" - extract $RPM_FILE $RPM_EXTRACT_DIR - - echo "Files to be kept from $RPM_NAME:" - for line in `cat $file`; do - echo "./$RPM_EXTRACT_DIR/$line" - echo "./$line" >> $KEEP_FILE_LIST - done - - done - - if [[ -f $CUSTOM_SCRIPT ]]; then - echo "Running stage specific script" - ./$CUSTOM_SCRIPT - - if [[ "$?" -ne 0 ]]; then - echo "Custom stage script failed, exiting." - exit 1 - fi - fi - - echo "Compressing files:" - cd $RPM_EXTRACT_DIR - tar --files-from=../$KEEP_FILE_LIST --exclude=CVS -cvzf ../../$STAGE_DEST_FILE - cd .. - - echo "Completed building $STAGE_DIR" - - cd .. - - done -} - -upload() -{ - UPLOAD_STAGE=$1 - - STAGE_FILE_LIST='' - for STAGE_DIR in $UPLOAD_STAGE; do - STAGE_FILE_LIST="$STAGE_FILE_LIST alpina-$STAGE_DIR.tar.gz" - done - - scp $STAGE_FILE_LIST $DEST_USER@$DEST_SERVER:$DEST_PATH -} - -clean() -{ - CLEAN_STAGE=$1 - - for STAGE_DIR in $CLEAN_STAGE; do - rm -rf $STAGE_DIR/$RPM_EXTRACT_DIR - rm -f $STAGE_DIR/$KEEP_FILE_LIST - - STAGE_DEST_FILE="alpina-$STAGE_DIR.tar.gz" - rm -f $STAGE_DEST_FILE - - echo "Cleaned $STAGE_DIR" - done -} - -extract() -{ - RPM=$1 - DEST=$2 - - mkdir -p $DEST - rpm2cpio $RPM > $DEST/out.cpio - (cd $DEST && cpio -ivd < out.cpio && rm out.cpio) -} - -usage() -{ - echo "Usage buildsupport.sh (build|upload|clean)"; -} - -# find out what do do -COMMAND=$1 -STAGE=$2 - - -if [[ -z "$STAGE" ]]; then - # if the stage is blank, build all - STAGE=$ALL_STAGES -else - # make sure the stage exists - if [[ ! -d "$STAGE" ]]; then - usage - exit 1 - fi -fi - -case "$COMMAND" in - build) build "$STAGE";; - upload) upload "$STAGE";; - clean) clean "$STAGE";; - *) usage; exit 1;; -esac