=== modified file 'lava_dispatcher/client/master.py'
@@ -63,17 +63,27 @@
raise RuntimeError("Failed to create tarball: %s" % tarfile)
+def _deploy_tarball_to_board(session, tarball_url, dest, timeout=-1):
+ decompression_char = ''
+ if tarball_url.endswith('.gz') or tarball_url.endswith('.tgz'):
+ decompression_char = 'z'
+ elif tarball_url.endswith('.bz2'):
+ decompression_char = 'j'
+ rc = session.run(
+ 'wget -qO- %s |tar --numeric-owner -C %s -x%sf -' % (
+ tarball_url, dest, decompression_char),
+ timeout=timeout)
+ if rc != 0:
+ msg = "Deploy: failed to deploy to %s" % dest
+ raise OperationFailed(msg)
+
+
def _deploy_linaro_rootfs(session, rootfs):
logging.info("Deploying linaro image")
session.run('udevadm trigger')
session.run('mkdir -p /mnt/root')
session.run('mount /dev/disk/by-label/testrootfs /mnt/root')
- rc = session.run(
- 'wget -qO- %s |tar --numeric-owner -C /mnt/root -xzf -' % rootfs,
- timeout=3600)
- if rc != 0:
- msg = "Deploy test rootfs partition: failed to download tarball."
- raise OperationFailed(msg)
+ _deploy_tarball_to_board(session, rootfs, '/mnt/root', timeout=3600)
session.run('echo linaro > /mnt/root/etc/hostname')
#DO NOT REMOVE - diverting flash-kernel and linking it to /bin/true
@@ -90,11 +100,7 @@
session.run('udevadm trigger')
session.run('mkdir -p /mnt/boot')
session.run('mount /dev/disk/by-label/testboot /mnt/boot')
- rc = session.run(
- 'wget -qO- %s |tar --numeric-owner -C /mnt/boot -xzf -' % bootfs)
- if rc != 0:
- msg = "Deploy test boot partition: failed to download tarball."
- raise OperationFailed(msg)
+ _deploy_tarball_to_board(session, bootfs, '/mnt/boot')
session.run('umount /mnt/boot')
def _deploy_linaro_android_testboot(session, boottbz2, pkgbz2=None):
@@ -106,11 +112,9 @@
session.run('mkdir -p /mnt/lava/boot')
session.run('mount /dev/disk/by-label/testboot '
'/mnt/lava/boot')
- session.run('wget -qO- %s |tar --numeric-owner -C /mnt/lava -xjf -' % boottbz2)
+ _deploy_tarball_to_board(session, boottbz2, '/mnt/lava')
if pkgbz2:
- session.run(
- 'wget -qO- %s |tar --numeric-owner -C /mnt/lava -xjf -'
- % pkgbz2)
+ _deploy_tarball_to_board(session, pkgbz2, '/mnt/lava')
_recreate_uInitrd(session)
@@ -167,9 +171,7 @@
session.run('mkdir -p /mnt/lava/system')
session.run(
'mount /dev/disk/by-label/testrootfs /mnt/lava/system')
- session.run(
- 'wget -qO- %s |tar --numeric-owner -C /mnt/lava -xjf -' % systemtbz2,
- timeout=600)
+ _deploy_tarball_to_board(session, systemtbz2, '/mnt/lava', timeout=600)
sed_cmd = "/dev_mount sdcard \/mnt\/sdcard/c dev_mount sdcard /mnt/sdcard %s " \
"/devices/platform/omap/omap_hsmmc.0/mmc_host/mmc0" %sdcard_part_lava