From patchwork Thu Jan 19 17:16:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 6300 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E2C9723E0C for ; Thu, 19 Jan 2012 17:16:16 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id C37BAA18478 for ; Thu, 19 Jan 2012 17:16:16 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so205060bkb.11 for ; Thu, 19 Jan 2012 09:16:16 -0800 (PST) Received: by 10.204.152.20 with SMTP id e20mr10266531bkw.117.1326993375074; Thu, 19 Jan 2012 09:16:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs17890bkc; Thu, 19 Jan 2012 09:16:14 -0800 (PST) Received: by 10.204.153.15 with SMTP id i15mr10247233bkw.43.1326993373502; Thu, 19 Jan 2012 09:16:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id q6si16898517bkd.103.2012.01.19.09.16.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 09:16:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Rnvav-0007E7-23 for ; Thu, 19 Jan 2012 17:16:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 01E5DE048E for ; Thu, 19 Jan 2012 17:16:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 197 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 197: deploy data partition in android Message-Id: <20120119171613.5471.95540.launchpad@ackee.canonical.com> Date: Thu, 19 Jan 2012 17:16:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14692"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: d206b8aeb0e223a2e0aebab62e0068a016ef455f Merge authors: Yongqin Liu (liuyq0307) Related merge proposals: https://code.launchpad.net/~liuyq0307/lava-dispatcher/mount-data-partition/+merge/89050 proposed by: Yongqin Liu (liuyq0307) review: Approve - Le Chi Thu (le-chi-thu) ------------------------------------------------------------ revno: 197 [merge] committer: Paul Larson branch nick: lava-dispatcher timestamp: Thu 2012-01-19 11:14:19 -0600 message: deploy data partition in android modified: lava_dispatcher/client/base.py lava_dispatcher/client/master.py lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf --- 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 === modified file 'lava_dispatcher/client/base.py' --- lava_dispatcher/client/base.py 2012-01-19 08:59:29 +0000 +++ lava_dispatcher/client/base.py 2012-01-19 11:16:49 +0000 @@ -339,6 +339,15 @@ dev_ip = session.get_default_nic_ip() if dev_ip is None: raise OperationFailed("failed to get board ip address") + try: + ## just disconnect the adb connection in case is remained + ## by last action or last job + ## that connection should be expired already + session.android_adb_disconnect(dev_ip) + except: + ## ignore all exception + ## this just in case of exception + pass session.android_adb_connect(dev_ip) session.wait_until_attached() session.wait_home_screen() === modified file 'lava_dispatcher/client/master.py' --- lava_dispatcher/client/master.py 2012-01-15 23:37:30 +0000 +++ lava_dispatcher/client/master.py 2012-01-19 09:40:30 +0000 @@ -128,6 +128,7 @@ data_part_org = session._client.device_option("data_part_android_org") # Sdcard layout in Lava image sys_part_lava = session._client.device_option("sys_part_android") + data_part_lava = session._client.device_option("data_part_android") session.run('mkdir -p ~/tmp/') session.run('mv /mnt/lava/boot/uInitrd ~/tmp') @@ -140,12 +141,16 @@ session.run( 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc' % cache_part_org) - session.run( - 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc' - % data_part_org) +# session.run( +# 'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc' +# % data_part_org) + session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc' + % (data_part_org, data_part_lava)) session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc' % (sys_part_org, sys_part_lava)) - # for snowball the mcvblk1 is used instead of mmcblk0. + # for snowball the mcvblk1 is used instead of mmcblk0. + session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc' + % (data_part_org, data_part_lava)) session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc' % (sys_part_org, sys_part_lava)) session.run( @@ -167,7 +172,7 @@ def _deploy_linaro_android_testrootfs(session, systemtbz2, rootfstype): logging.info("Deploying the test root filesystem") - sdcard_part_lava = session._client.device_option("sdcard_part_android") +# sdcard_part_lava = session._client.device_option("sdcard_part_android") session.run('umount /dev/disk/by-label/testrootfs') session.run( @@ -178,10 +183,10 @@ 'mount /dev/disk/by-label/testrootfs /mnt/lava/system') _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 - session.run( - 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd) +# 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 +# session.run( +# 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd) session.run('sed -i "s/^PS1=.*$/PS1=\'root@linaro: \'/" /mnt/lava/system/etc/mkshrc') session.run('umount /mnt/lava/system') @@ -190,6 +195,15 @@ session.run('mkfs.vfat /dev/disk/by-label/sdcard -n sdcard') session.run('udevadm trigger') +def _deploy_linaro_android_data(session, datatbz2): + ##consider the compatiblity, here use the existed sdcard partition + data_label = 'sdcard' + session.run('mkfs.ext4 -q /dev/disk/by-label/%s -L %s' % (data_label, data_label)) + session.run('udevadm trigger') + session.run('mkdir -p /mnt/lava/data') + session.run('mount /dev/disk/by-label/%s /mnt/lava/data' % (data_label)) + _deploy_tarball_to_board(session, datatbz2, '/mnt/lava', timeout=600) + session.run('umount /mnt/lava/data') class PrefixCommandRunner(CommandRunner): """A CommandRunner that prefixes every command run with a given string. @@ -317,14 +331,15 @@ boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '') system_tarball = system_tbz2.replace(LAVA_IMAGE_TMPDIR, '') - #data_tarball = data_tbz2.replace(LAVA_IMAGE_TMPDIR, '') + data_tarball = data_tbz2.replace(LAVA_IMAGE_TMPDIR, '') boot_url = '/'.join(u.strip('/') for u in [ LAVA_IMAGE_URL, boot_tarball]) system_url = '/'.join(u.strip('/') for u in [ LAVA_IMAGE_URL, system_tarball]) - #data_url = '/'.join(u.strip('/') for u in [ - # LAVA_IMAGE_URL, data_tarball]) + data_url = '/'.join(u.strip('/') for u in [ + LAVA_IMAGE_URL, data_tarball]) + if pkg_tbz2: pkg_tarball = pkg_tbz2.replace(LAVA_IMAGE_TMPDIR, '') pkg_url = '/'.join(u.strip('/') for u in [ @@ -335,7 +350,8 @@ try: _deploy_linaro_android_testboot(session, boot_url, pkg_url) _deploy_linaro_android_testrootfs(session, system_url, rootfstype) - _purge_linaro_android_sdcard(session) +# _purge_linaro_android_sdcard(session) + _deploy_linaro_android_data(session, data_url) except: tb = traceback.format_exc() self.sio.write(tb) === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-01-18 00:13:44 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-01-18 16:46:35 +0000 @@ -71,7 +71,10 @@ # sys partition number in LAVA test image, counting from 1 sys_part_android = 5 # sdcard partition number in LAVA test image, counting from 1 -sdcard_part_android = 6 +#sdcard_part_android = 6 + +# data partition number in LAVA test image, counting from 1 +data_part_android = 6 # Master image recognization string MASTER_STR = root@master === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf 2012-01-18 07:41:42 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf 2012-01-18 17:12:47 +0000 @@ -14,5 +14,5 @@ setenv bootargs "'console=tty0 console=ttyO2,115200n8 rootwait rw earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000 - init=/init androidboot.console=ttyO2 no_console_suspend'", + init=/init androidboot.console=ttyO2'", boot