X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FValidateNodeInstall.py;h=2e807144de77600201f55fa8049383754d44e60d;hb=bb5fbc8ba39ef808bff8f2ec5c2eda7c11b5304e;hp=aea2e1744bb83397fee6cdfb88542cb42d70e4a6;hpb=882428789c176d1b05ea18dbd7f306934ab09fe4;p=bootmanager.git diff --git a/source/steps/ValidateNodeInstall.py b/source/steps/ValidateNodeInstall.py index aea2e17..2e80714 100644 --- a/source/steps/ValidateNodeInstall.py +++ b/source/steps/ValidateNodeInstall.py @@ -4,6 +4,7 @@ from Exceptions import * import utils from systeminfo import systeminfo import compatibility +import ModelOptions def Run( vars, log ): @@ -44,6 +45,8 @@ 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: @@ -81,6 +84,7 @@ def Run( vars, log ): 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 ) except BootManagerException, e: log.write( "BootManagerException during vgscan/vgchange: %s\n" % str(e) ) @@ -89,15 +93,21 @@ def Run( vars, log ): 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 & ModelOptions.SMP: + 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