import BootAPI
import notify_messages
+from GetAndUpdateNodeDetails import SMP_OPT
+
def Run( vars, log ):
"""
# its ok if this is blank
NODE_SESSION= vars["NODE_SESSION"]
+ NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"]
+
except KeyError, var:
raise BootManagerException, "Missing variable in vars: %s\n" % var
except ValueError, var:
(network_count,storage_count)= \
InstallWriteConfig.write_modprobeconf_file( vars, log )
+ # get the kernel version
+ option = ''
+ if NODE_MODEL_OPTIONS & SMP_OPT:
+ option = 'smp'
+
log.write( "Copying kernel and initrd for booting.\n" )
- utils.sysexec( "cp %s/boot/kernel-boot /tmp/kernel" % SYSIMG_PATH, log )
- utils.sysexec( "cp %s/boot/initrd-boot /tmp/initrd" % SYSIMG_PATH, log )
+ utils.sysexec( "cp %s/boot/kernel-boot%s /tmp/kernel" % (SYSIMG_PATH,option), log )
+ utils.sysexec( "cp %s/boot/initrd-boot%s /tmp/initrd" % (SYSIMG_PATH,option), log )
log.write( "Unmounting disks.\n" )
try:
from systeminfo import systeminfo
import BootAPI
+from GetAndUpdateNodeDetails import SMP_OPT
def Run( vars, log ):
if BOOT_CD_VERSION == "":
raise ValueError, "BOOT_CD_VERSION"
+ NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"]
+
except KeyError, var:
raise BootManagerException, "Missing variable in vars: %s\n" % var
except ValueError, var:
rootdev= file( "%s/%s" % (SYSIMG_PATH,PARTITIONS["mapper-root"]), "w" )
rootdev.close()
- initrd= os.readlink( "%s/boot/initrd-boot" % SYSIMG_PATH )
+ option = ''
+ if NODE_MODEL_OPTIONS & SMP_OPT:
+ option = 'smp'
+ initrd= os.readlink( "%s/boot/initrd-boot%s" % (SYSIMG_PATH,option) )
kernel_version= initrd.replace("initrd-", "").replace(".img", "")
utils.removefile( "%s/boot/%s" % (SYSIMG_PATH, initrd) )
utils.sysexec( "chroot %s mkinitrd /boot/initrd-%s.img %s" % \
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:
# get the kernel version
- initrd= os.readlink( "%s/boot/initrd-boot" % SYSIMG_PATH )
+ option = ''
+ if NODE_MODEL_OPTIONS & SMP_OPT:
+ option = 'smp'
+ initrd= os.readlink( "%s/boot/initrd-boot%s" % (SYSIMG_PATH,option) )
kernel_version= initrd.replace("initrd-", "").replace(".img", "")
sysinfo= systeminfo()
import utils
from systeminfo import systeminfo
import compatibility
+from GetAndUpdateNodeDetails import SMP_OPT
def Run( vars, log ):
if PLCONF_DIR == "":
raise ValueError, "PLCONF_DIR"
+ NODE_MODEL_OPTIONS= vars["NODE_MODEL_OPTIONS"]
+
except KeyError, var:
raise BootManagerException, "Missing variable in vars: %s\n" % var
except ValueError, var:
ROOT_MOUNTED= 1
vars['ROOT_MOUNTED']= 1
- valid= 0
- if os.access("%s/boot/kernel-boot" % SYSIMG_PATH, os.F_OK | os.R_OK) and \
- os.access("%s/boot/initrd-boot" % SYSIMG_PATH, os.F_OK | os.R_OK):
- valid= 1
-
+ # get the kernel version
+ option = ''
+ if NODE_MODEL_OPTIONS & SMP_OPT:
+ option = 'smp'
+
+ files = ("kernel-boot%s" % option, "initrd-boot%s" % option)
+ valid= 1
+ for filepath in files:
+ if not os.access("%s/boot/%s"%(SYSIMG_PATH,filepath),os.F_OK|os.R_OK):
+ log.write( "Node not properly installed:\n")
+ log.write( "\tmissing file /boot/%s\n" % filepath )
+ valid= 0
+
if not valid:
- log.write( "Node does not appear to be installed correctly:\n" )
- log.write( "missing file /boot/ initrd-boot or kernel-boot\n" )
return 0
# write out the node id to /etc/planetlab/node_id. if this fails, return