X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FInitializeBootManager.py;h=c98f960bf44cefad9737828a120ab743d66534df;hb=0e57d290f7ee2c4c05bff3048229ea2b58d3d506;hp=24abbb43228da8a4a1030620ae6e151a4929da50;hpb=ea2b4123414dbbf8666810f4d1cc467a813e4718;p=bootmanager.git diff --git a/source/steps/InitializeBootManager.py b/source/steps/InitializeBootManager.py index 24abbb4..c98f960 100644 --- a/source/steps/InitializeBootManager.py +++ b/source/steps/InitializeBootManager.py @@ -1,3 +1,11 @@ +#!/usr/bin/python +# +# 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 @@ -12,7 +20,7 @@ BOOT_VERSION_2X_FILE='/usr/bootme/ID' BOOT_VERSION_3X_FILE='/pl_version' # minimium version of the boot os we need to run, as a (major,minor) tuple -MINIMUM_BOOT_VERSION= (2,0) +MINIMUM_BOOT_VERSION= (3,0) # minimum version of python required to run the boot manager MINIMUM_PYTHON_VERSION= (2,2,0) @@ -24,12 +32,28 @@ 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" ) - + # Default model option. Required in case we go into debug mode + # before we successfully called GetAndUpdateNodeDetails(). + vars["NODE_MODEL_OPTIONS"] = vars.get("NODE_MODEL_OPTIONS",0) + + # 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 ) @@ -48,23 +72,11 @@ def Run( vars, log ): BOOT_CD_VERSION= vars['BOOT_CD_VERSION'] - # old cds need extra modules loaded for compaq smart array - if BOOT_CD_VERSION[0] == 2: - - has_smartarray= utils.sysexec_noerr( - 'lspci | egrep "0e11:b178|0e11:4070|0e11:4080|0e11:4082|0e11:4083"') - - if has_smartarray: - log.write( "Loading support for Compaq smart array\n" ) - utils.sysexec_noerr( "modprobe cciss", log ) - _create_cciss_dev_entries() - - - has_fusion= utils.sysexec_noerr('lspci | egrep "1000:0030"') - - if has_fusion: - log.write( "Loading support for Fusion MPT SCSI controllers\n" ) - utils.sysexec_noerr( "modprobe mptscsih", log ) + # In case we are booted with a kernel that does not have the + # device mapper code compiled into the kernel. + if not os.path.exists("/dev/mapper"): + log.write( "Loading support for LVM\n" ) + utils.sysexec_noerr( "modprobe dm_mod", log ) # for anything that needs to know we are running under the boot cd and # not the runtime os