[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 78: Some minor changes to fix sudo, and work around a lmc issue where some

Message ID 20110721042121.10364.79318.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson July 21, 2011, 4:21 a.m.
------------------------------------------------------------
revno: 78
committer: Paul Larson <paul.larson@canonical.com>
branch nick: lava-dispatcher
timestamp: Wed 2011-07-20 21:48:54 -0500
message:
  Some minor changes to fix sudo, and work around a lmc issue where some
  images are too big to fit in the 2G default image size.
modified:
  lava_dispatcher/actions/deploy.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

Patch

=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py	2011-07-20 09:41:30 +0000
+++ lava_dispatcher/actions/deploy.py	2011-07-21 02:48:54 +0000
@@ -83,17 +83,17 @@ 
         """
         error_msg = None
         mntdir = mkdtemp()
-        cmd = "mount -o loop,offset=%s %s %s" % (offset, image, mntdir)
+        cmd = "sudo mount -o loop,offset=%s %s %s" % (offset, image, mntdir)
         rc, output = getstatusoutput(cmd)
         if rc:
             os.rmdir(mntdir)
             raise RuntimeError("Unable to mount image %s at offset %s" % (
                 image, offset))
-        cmd = "tar -C %s -czf %s ." % (mntdir, tarfile)
+        cmd = "sudo tar -C %s -czf %s ." % (mntdir, tarfile)
         rc, output = getstatusoutput(cmd)
         if rc:
             error_msg = "Failed to create tarball: %s" % tarfile
-        cmd = "umount %s" % mntdir
+        cmd = "sudo umount %s" % mntdir
         rc, output = getstatusoutput(cmd)
         os.rmdir(mntdir)
         if error_msg:
@@ -118,8 +118,8 @@ 
 
         image_file = os.path.join(tarball_dir, "lava.img")
         board = client.board
-        cmd = ("linaro-media-create --hwpack-force-yes --dev %s "
-               "--image_file %s --binary %s --hwpack %s" % (
+        cmd = ("sudo linaro-media-create --hwpack-force-yes --dev %s "
+               "--image_file %s --binary %s --hwpack %s --image_size 3G" % (
                 board.type, image_file, rootfs_path, hwpack_path))
         rc, output = getstatusoutput(cmd)
         if rc: