Merge disconnected operations branch.
[bootmanager.git] / source / steps / ChainBootNode.py
index b04756d..cccd37f 100644 (file)
@@ -18,6 +18,7 @@ import compatibility
 import systeminfo
 import BootAPI
 import notify_messages
+import time
 
 import ModelOptions
 
@@ -124,8 +125,11 @@ def Run( vars, log ):
 
     # update node packages
     log.write( "Running node update.\n" )
-    cmd = "chroot %s /usr/bin/NodeUpdate.py start noreboot" \
-          % SYSIMG_PATH
+    if os.path.exists( SYSIMG_PATH + "/usr/bin/NodeUpdate.py" ):
+        cmd = "chroot %s /usr/bin/NodeUpdate.py start noreboot" % SYSIMG_PATH
+    else:
+        # for backwards compatibility
+        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" )
@@ -151,6 +155,8 @@ def Run( vars, 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 )
 
+    BootAPI.save(vars)
+
     log.write( "Unmounting disks.\n" )
     try:
         # backwards compat, though, we should never hit this case post PL 3.2
@@ -200,6 +206,9 @@ def Run( vars, log ):
             if module != "":
                 log.write( "Unloading %s\n" % module )
                 utils.sysexec_noerr( "modprobe -r %s" % module, log )
+            if module == "e1000":
+                log.write("Unloading e1000 driver; sleeping 4 seconds...\n")
+                time.sleep(4)
 
         modules.close()
     except IOError:
@@ -234,7 +243,7 @@ def Run( vars, log ):
                 # problems during chain boot, such as USB host
                 # controller drivers (HCDs) (PL6577).
                 # if int(parts[2]) == 0:
-                if re.search('_hcd$', parts[0]):
+                if False and re.search('_hcd$', parts[0]):
                     if usb_usage > 0:
                         log.write( "NOT unloading %s since USB may be in use\n" % parts[0] )
                     else: