From patchwork Tue Jan 3 17:46: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: 6031 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 A15BE23E0C for ; Tue, 3 Jan 2012 17:46:15 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 949C0A1859E for ; Tue, 3 Jan 2012 17:46:15 +0000 (UTC) Received: by eeke52 with SMTP id e52so16997091eek.11 for ; Tue, 03 Jan 2012 09:46:15 -0800 (PST) Received: by 10.204.133.207 with SMTP id g15mr11772559bkt.17.1325612775289; Tue, 03 Jan 2012 09:46: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 ac16cs346135bkc; Tue, 3 Jan 2012 09:46:14 -0800 (PST) Received: by 10.180.81.72 with SMTP id y8mr116003158wix.14.1325612773673; Tue, 03 Jan 2012 09:46:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gb16si24175549wbb.58.2012.01.03.09.46.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jan 2012 09:46: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 1Ri8RB-0001f6-BX for ; Tue, 03 Jan 2012 17:46:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 4B443E03B0 for ; Tue, 3 Jan 2012 17:46: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: 184 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 184: Added rootfstype option for deploying images Message-Id: <20120103174613.3095.44551.launchpad@ackee.canonical.com> Date: Tue, 03 Jan 2012 17:46: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="14616"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 19a229f51ee3bc2f366e6139287867e2598300f7 Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/specify-fs/+merge/86186 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Spring Zhang (qzhang) ------------------------------------------------------------ revno: 184 [merge] committer: Paul Larson branch nick: lava-dispatcher timestamp: Tue 2012-01-03 11:43:52 -0600 message: Added rootfstype option for deploying images modified: lava_dispatcher/actions/android_deploy.py lava_dispatcher/actions/deploy.py lava_dispatcher/client/base.py lava_dispatcher/client/lmc_utils.py lava_dispatcher/client/master.py lava_dispatcher/client/qemu.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 === modified file 'lava_dispatcher/actions/android_deploy.py' --- lava_dispatcher/actions/android_deploy.py 2011-11-24 03:00:54 +0000 +++ lava_dispatcher/actions/android_deploy.py 2011-12-19 02:23:53 +0000 @@ -23,5 +23,5 @@ class cmd_deploy_linaro_android_image(BaseAction): - def run(self, boot, system, data, pkg=None, use_cache=True): - self.client.deploy_linaro_android(boot, system, data, pkg, use_cache) + def run(self, boot, system, data, pkg=None, use_cache=True, rootfstype='ext4'): + self.client.deploy_linaro_android(boot, system, data, pkg, use_cache, rootfstype) === modified file 'lava_dispatcher/actions/deploy.py' --- lava_dispatcher/actions/deploy.py 2011-11-21 04:21:06 +0000 +++ lava_dispatcher/actions/deploy.py 2011-12-19 01:40:25 +0000 @@ -21,6 +21,6 @@ class cmd_deploy_linaro_image(BaseAction): - def run(self, hwpack, rootfs, kernel_matrix=None, use_cache=True): + def run(self, hwpack, rootfs, kernel_matrix=None, use_cache=True, rootfstype='ext3'): self.client.deploy_linaro( - hwpack, rootfs, kernel_matrix=None, use_cache=True) + hwpack, rootfs, kernel_matrix=None, use_cache=True, rootfstype=rootfstype) === modified file 'lava_dispatcher/client/base.py' --- lava_dispatcher/client/base.py 2011-12-06 21:01:44 +0000 +++ lava_dispatcher/client/base.py 2011-12-19 02:23:53 +0000 @@ -366,7 +366,7 @@ raise OperationFailed logging.info("System is in test image now") - def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True): + def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True, rootfstype='ext3'): raise NotImplementedError(self.deploy_linaro) def boot_master_image(self): @@ -390,6 +390,9 @@ # Android stuff + def deploy_linaro_android(self, boot, system, data, pkg=None, use_cache=True, rootfstype='ext4'): + raise NotImplementedError(self.deploy_linaro_android) + def boot_linaro_android_image(self): """Reboot the system to the test android image.""" self.proc._boot(string_to_list(self.config.get('boot_cmds_android'))) === modified file 'lava_dispatcher/client/lmc_utils.py' --- lava_dispatcher/client/lmc_utils.py 2011-12-15 16:36:00 +0000 +++ lava_dispatcher/client/lmc_utils.py 2011-12-19 01:44:12 +0000 @@ -54,7 +54,7 @@ return new_hwpack_path -def generate_image(client, hwpack_url, rootfs_url, kernel_matrix, use_cache=True): +def generate_image(client, hwpack_url, rootfs_url, kernel_matrix, use_cache=True, rootfstype=None): """Generate image from a hwpack and rootfs url :param hwpack_url: url of the Linaro hwpack to download @@ -113,6 +113,8 @@ 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.lmc_dev_arg, image_file, rootfs_path, hwpack_path)) + if rootfstype is not None: + cmd += ' --rootfs ' + rootfstype logging.info("Executing the linaro-media-create command") logging.info(cmd) rc, output = getstatusoutput(cmd) === modified file 'lava_dispatcher/client/master.py' --- lava_dispatcher/client/master.py 2011-12-11 17:12:43 +0000 +++ lava_dispatcher/client/master.py 2011-12-19 02:23:53 +0000 @@ -160,13 +160,13 @@ session.run('mv ~/tmp/uInitrd /mnt/lava/boot/uInitrd') session.run('rm -rf ~/tmp') -def _deploy_linaro_android_testrootfs(session, systemtbz2): +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") session.run('umount /dev/disk/by-label/testrootfs') session.run( - 'mkfs.ext4 -q /dev/disk/by-label/testrootfs -L testrootfs') + 'mkfs -t %s -q /dev/disk/by-label/testrootfs -L testrootfs' % rootfstype) session.run('udevadm trigger') session.run('mkdir -p /mnt/lava/system') session.run( @@ -244,7 +244,7 @@ def master_str(self): return self.device_option("MASTER_STR") - def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True): + def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True, rootfstype='ext3'): LAVA_IMAGE_TMPDIR = self.context.lava_image_tmpdir LAVA_IMAGE_URL = self.context.lava_image_url try: @@ -264,7 +264,7 @@ root_url = '/'.join(u.strip('/') for u in [ LAVA_IMAGE_URL, root_tarball]) with self._master_session() as session: - self._format_testpartition(session) + self._format_testpartition(session, rootfstype) logging.info("Waiting for network to come up") try: @@ -284,7 +284,7 @@ finally: shutil.rmtree(os.path.dirname(boot_tgz)) - def deploy_linaro_android(self, boot, system, data, pkg=None, use_cache=True): + def deploy_linaro_android(self, boot, system, data, pkg=None, use_cache=True, rootfstype='ext4'): LAVA_IMAGE_TMPDIR = self.context.lava_image_tmpdir LAVA_IMAGE_URL = self.context.lava_image_url logging.info("Deploying Android on %s" % self.hostname) @@ -330,7 +330,7 @@ try: _deploy_linaro_android_testboot(session, boot_url, pkg_url) - _deploy_linaro_android_testrootfs(session, system_url) + _deploy_linaro_android_testrootfs(session, system_url, rootfstype) _purge_linaro_android_sdcard(session) except: tb = traceback.format_exc() @@ -391,11 +391,12 @@ self.proc.sendline('export PS1="$PS1 [rc=$(echo \$?)]: "') self.proc.expect(self.master_str, timeout=10, lava_no_logging=1) - def _format_testpartition(self, session): + def _format_testpartition(self, session, fstype): logging.info("Format testboot and testrootfs partitions") session.run('umount /dev/disk/by-label/testrootfs') session.run( - 'mkfs.ext3 -q /dev/disk/by-label/testrootfs -L testrootfs') + 'mkfs -t %s -q /dev/disk/by-label/testrootfs -L testrootfs' + % fstype) session.run('umount /dev/disk/by-label/testboot') session.run('mkfs.vfat /dev/disk/by-label/testboot -n testboot') === modified file 'lava_dispatcher/client/qemu.py' --- lava_dispatcher/client/qemu.py 2011-11-30 02:06:29 +0000 +++ lava_dispatcher/client/qemu.py 2011-12-19 01:44:12 +0000 @@ -44,8 +44,8 @@ super(LavaQEMUClient, self).__init__(context, config) self._lava_image = None - def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True): - image_file = generate_image(self, hwpack, rootfs, kernel_matrix, use_cache) + def deploy_linaro(self, hwpack, rootfs, kernel_matrix=None, use_cache=True, rootfstype='ext3'): + image_file = generate_image(self, hwpack, rootfs, kernel_matrix, use_cache, rootfstype) self._lava_image = image_file with image_partition_mounted(self._lava_image, self.root_part) as mntdir: logging_system('echo linaro > %s/etc/hostname' % mntdir)