From patchwork Thu Apr 25 10:02:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Pigott X-Patchwork-Id: 16393 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 998032395D for ; Thu, 25 Apr 2013 10:03:11 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id hr11sf1017027vcb.10 for ; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=LMIDMsphS+GgloIqAP1SPCGDL8H0m48zPfZWYQRFPq8=; b=bLHJb6ftwg7p2mKGRG6WV6dDCCkw9VmtdLiepVPsU6VAYczc1dadHfL1pHKJN61j9u O9qk/o5+0IASJvr2J7LANm0MuvAKwqK58+iGnyRBCyT5g76XcJ8FF6IJMC3DPWamc6tu ajjF4umoYfNpdbY4N4oNWvFluCwRWQsIDQwHVlk2yhV3WYEaZfUn1mEDZXSzyliy/6jP 0yx2EtQ3eIHsf4kqt+2jM4eVzeQroXC6YgR0zadqWu9cYJE66e7aycTGNccYgNBGvXMp nQl6bIhFtRCjqwmxRzjhXS6+VBwblA1A9XAVyZvbq4fHTOv9bYxk5qTaOoD7BU++32ty HZDA== X-Received: by 10.224.18.133 with SMTP id w5mr13393422qaa.1.1366884138596; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.101 with SMTP id f5ls1370559qes.1.gmail; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) X-Received: by 10.52.26.102 with SMTP id k6mr498790vdg.127.1366884138324; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id sx2si2981429vdc.71.2013.04.25.03.02.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Apr 2013 03:02:18 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id d10so1163213vea.26 for ; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr22697532vdu.8.1366884138168; Thu, 25 Apr 2013 03:02:18 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp14918veb; Thu, 25 Apr 2013 03:02:17 -0700 (PDT) X-Received: by 10.194.83.33 with SMTP id n1mr74638645wjy.7.1366884136958; Thu, 25 Apr 2013 03:02:16 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id m2si8989286wie.86.2013.04.25.03.02.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 25 Apr 2013 03:02:16 -0700 (PDT) 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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UVJ0K-0004eL-9i for ; Thu, 25 Apr 2013 10:02:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 3C7EDE013D for ; Thu, 25 Apr 2013 10:02:16 +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: 588 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 588: Add uefi interactive boot support Message-Id: <20130425100216.24058.58253.launchpad@ackee.canonical.com> Date: Thu, 25 Apr 2013 10:02:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16580"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 1bd5217219a1282082037ef37e61240933d700d1 X-Gm-Message-State: ALoCoQlwnUWLtnBZRj8AwV1hrHAMsvjmAnLPKevss0QMINKStvd70JjyPQlgAozag8c9JjHW71zx X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::235 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Dave Pigott (dpigott) Related merge proposals: https://code.launchpad.net/~dpigott/lava-dispatcher/add-arndale-uefi-support/+merge/155765 proposed by: Dave Pigott (dpigott) review: Needs Fixing - Antonio Terceiro (terceiro) review: Resubmit - Dave Pigott (dpigott) ------------------------------------------------------------ revno: 588 [merge] committer: dave.pigott@linaro.org branch nick: trunk timestamp: Thu 2013-04-25 11:00:17 +0100 message: Add uefi interactive boot support added: lava_dispatcher/default-config/lava-dispatcher/device-types/arndale-uefi.conf lava_dispatcher/device/uefi.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 === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/arndale-uefi.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/arndale-uefi.conf 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/arndale-uefi.conf 2013-04-17 09:33:07 +0000 @@ -0,0 +1,48 @@ +boot_part = 2 +root_part = 3 + +boot_cmds = sendline a, + expect Choice:, + sendline 1, + expect Select the Boot Device:, + sendline 2, + expect File path of the EFI Application or the kernel:, + sendline uImage, + expect Boot Type: [a] ATAGS, [g] Global FDT or [l] Local FDT? [a/g/l], + sendline g, + expect Add an initrd: [y/n], + sendline y, + expect File path of the initrd:, + sendline uInitrd, + expect Arguments to pass to the binary:, + sendline "root=/dev/mmcblk1p6 rw rootwait console=ttySAC2,115200n8 init --no-log", + expect Description for this new Entry:, + sendline Test Image, + expect Choice:, + sendline 5, + expect Start:, + sendline 2 + + +client_type = uefi + +boot_cmds_android = 3 + +interrupt_boot_prompt = The default boot selection will start in + +bootloader_prompt = Start: + +lmc_dev_arg = arndale + +# Original linaro-android-media-create generated Android system SD card layout +boot_part_android_org = 2 +sys_part_android_org = 3 +cache_part_android_org = 5 +data_part_android_org = 6 +sdcard_part_android_org = 7 + +# Android LAVA test image SD card layout +sys_part_android = 6 +sdcard_part_android = 7 +data_part_android = 7 + === added file 'lava_dispatcher/device/uefi.py' --- lava_dispatcher/device/uefi.py 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/device/uefi.py 2013-04-17 09:37:29 +0000 @@ -0,0 +1,60 @@ +# Copyright (C) 2013 Linaro Limited +# +# Author: Dave Pigott +# +# This file is part of LAVA Dispatcher. +# +# LAVA Dispatcher is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LAVA Dispatcher is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along +# with this program; if not, see . + +import logging +import re +from lava_dispatcher.device.master import ( + MasterImageTarget +) + +class UEFITarget(MasterImageTarget): + + def __init__(self, context, config): + super(UEFITarget, self).__init__(context, config) + + def _boot(self, boot_cmds): + """ + + :param boot_cmds: + :raise: + """ + try: + self._soft_reboot() + self._enter_bootloader() + except: + logging.exception("enter uefi failed") + self._hard_reboot() + self._enter_bootloader() + self.proc.expect(self.config.bootloader_prompt, timeout=300) + for line in range(0, len(boot_cmds)): + parts = re.match('^(?Psendline|expect)\s*(?P.*)', line) + try: + action = parts.group('action') + command = re.escape(parts.group('command')) + except AttributeError as e: + raise Exception("Badly formatted command in boot_cmds %s" % e) + if action == "sendline": + self.proc.sendline(command) + elif action == "expect": + self.proc.expect(command, timeout=300) + else: + raise Exception("Unrecognised action in boot_cmds") + +target_class = UEFITarget