diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 133: Support Snowball v3 boards in lava-dispatcher

Message ID 20111014193313.30757.68465.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson Oct. 14, 2011, 7:33 p.m. UTC
Merge authors:
  Paul Larson (pwlars)
Related merge proposals:
  https://code.launchpad.net/~pwlars/lava-dispatcher/snowball-support/+merge/79185
  proposed by: Paul Larson (pwlars)
------------------------------------------------------------
revno: 133 [merge]
committer: Paul Larson <paul.larson@canonical.com>
branch nick: lava-dispatcher
timestamp: Fri 2011-10-14 14:31:25 -0500
message:
  Support Snowball v3 boards in lava-dispatcher
modified:
  lava_dispatcher/actions/deploy.py
  lava_dispatcher/client.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py	2011-10-14 05:04:20 +0000
+++ lava_dispatcher/actions/deploy.py	2011-10-14 19:31:25 +0000
@@ -156,6 +156,13 @@ 
             rootfs_path = download(rootfs_url, tarball_dir)
 
         image_file = os.path.join(tarball_dir, "lava.img")
+        #XXX Hack for removing startupfiles from snowball hwpacks
+        if client.device_type == "snowball_sd":
+            cmd = "sudo linaro-hwpack-replace -r startupfiles-v3 -t %s -i" % hwpack_path
+            rc, output = getstatusoutput(cmd)
+            if rc:
+                raise RuntimeError("linaro-hwpack-replace failed: %s" % output)
+
         cmd = ("sudo flock /var/lock/lava-lmc.lck linaro-media-create --hwpack-force-yes --dev %s "
                "--image_file %s --binary %s --hwpack %s --image_size 3G" %
                (client.device_type, image_file, rootfs_path, hwpack_path))

=== modified file 'lava_dispatcher/client.py'
--- lava_dispatcher/client.py	2011-09-23 02:53:30 +0000
+++ lava_dispatcher/client.py	2011-10-14 19:28:59 +0000
@@ -140,15 +140,22 @@ 
 
     def soft_reboot(self):
         self.proc.sendline("reboot")
-        # set soft reboot timeout 60s, or do a hard reset
-        id = self.proc.expect(['Restarting system', pexpect.TIMEOUT],
-                timeout=60)
+        # set soft reboot timeout 120s, or do a hard reset
+        id = self.proc.expect(['Will now restart', pexpect.TIMEOUT],
+            timeout=120)
         if id != 0:
             self.hard_reboot()
 
     def hard_reboot(self):
         self.proc.send("~$")
         self.proc.sendline("hardreset")
+        # XXX Workaround for snowball
+        if self.device_type == "snowball_sd":
+            time.sleep(10)
+            self.in_master_shell()
+            # Intentionally avoid self.soft_reboot() to prevent looping
+            self.proc.sendline("reboot")
+            self.enter_uboot()
 
     def run_shell_command(self, cmd, response=None, timeout=-1):
         self.empty_pexpect_buffer()