utils.makedirs( SYSIMG_PATH )
try:
+ # first run fsck to prevent fs corruption from hanging mount...
+ log.write( "fsck root file system\n" )
+ utils.sysexec("e2fsck -v -p %s" % (PARTITIONS["root"]),log)
+
+ log.write( "fsck vserver file system\n" )
+ utils.sysexec("e2fsck -v -p %s" % (PARTITIONS["vservers"]),log)
+ except BootManagerException, e:
+ log.write( "BootManagerException during fsck of /root and /vservers : %s\n" %
+ str(e) )
+
+ try:
+ # then attempt to mount them
log.write( "mounting root file system\n" )
utils.sysexec("mount -t ext3 %s %s" % (PARTITIONS["root"],SYSIMG_PATH),log)
-
+
+ VSERVERS_PATH = "%s/vservers" % SYSIMG_PATH
+ utils.makedirs(VSERVERS_PATH)
log.write( "mounting vserver partition in root file system\n" )
- utils.sysexec("mount -t ext3 %s %s/vservers" % \
- (PARTITIONS["vservers"], SYSIMG_PATH), log)
+ utils.sysexec("mount -t ext3 %s %s" % (PARTITIONS["vservers"], VSERVERS_PATH), log)
+ PROC_PATH = "%s/proc" % SYSIMG_PATH
+ utils.makedirs(PROC_PATH)
log.write( "mounting /proc\n" )
- utils.sysexec( "mount -t proc none %s/proc" % SYSIMG_PATH, log )
+ utils.sysexec( "mount -t proc none %s" % PROC_PATH, log )
except BootManagerException, e:
log.write( "BootManagerException during mount of /root, /vservers and /proc: %s\n" %
str(e) )
vars['ROOT_MOUNTED']= 1
- # check if the base kernel is installed
+ # check if the base kernel is installed
+ # these 2 links are created by our kernel's post-install scriplet
+ log.write("Checking for a custom kernel\n")
try:
os.stat("%s/boot/kernel-boot" % SYSIMG_PATH)
os.stat("%s/boot/initrd-boot" % SYSIMG_PATH)
except OSError, e:
- log.write( "FATAL: Couldn't locate base kernel.\n")
+ log.write( "Couldn't locate base kernel (you might be using the stock kernel).\n")
return 0
# check if the model specified kernel is installed
log.write( "Unable to write out /etc/planetlab/node_id\n" )
return 0
- log.write( "Everything appears to be ok\n" )
+ log.write( "Node installation appears to be ok\n" )
return 1