From patchwork Wed Sep 4 19:53:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 19766 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF92224869 for ; Wed, 4 Sep 2013 19:53:26 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf914990yha.5 for ; Wed, 04 Sep 2013 12:53:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:to:from:subject :message-id:date:reply-to:sender:errors-to:precedence :x-original-sender:x-original-authentication-results:mailing-list :list-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=5rhDlN3PIIdq5KT8CuArDgdT6wQqilwdVYRA/wWUOiM=; b=DL3Ld7dZZ8K9a0YMAJIz+HtCV2P4o5r5n2GvS8gScwQksn6WGMboCge/JqkoN0NCVQ F90xp0tJitnOaK5xbe30sHDQ4Xy44hspUvunToA8kaA6t4bD6SaLpeKPqKrLVEevuLqi oP9esx9VD92iGP5jWSXy1y0HnsHfm3LiCPVMswI0GXAbaK0T57R0J2Bi8/ioqjAluIZ2 k/iRsNRGZU2LnGoXuNBay37sy3MqozxB5yTc5lYD7mXuGbzsQDL5snBrFIdlcKUcE7Ky 4AqrCaGBBdytWQ6Kf20KIa1GoHzYTZ0jbu8deNX+PFmK0FV2tOQMvjHdLjokus7wqFXH DTIQ== X-Received: by 10.236.115.198 with SMTP id e46mr1731852yhh.33.1378324406501; Wed, 04 Sep 2013 12:53:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.204 with SMTP id k12ls216695qej.25.gmail; Wed, 04 Sep 2013 12:53:26 -0700 (PDT) X-Received: by 10.221.27.73 with SMTP id rp9mr345299vcb.29.1378324406373; Wed, 04 Sep 2013 12:53:26 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id bp7si6265027vcb.82.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Sep 2013 12:53:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so491286vbf.24 for ; Wed, 04 Sep 2013 12:53:26 -0700 (PDT) X-Gm-Message-State: ALoCoQmipRP/Njb/MOqqeQNca+g8k+4BqJLBCQR2l5ZMIj4HE6QuWCjIXazSshYDESq4Sb7cczdE X-Received: by 10.52.165.131 with SMTP id yy3mr2895470vdb.25.1378324406250; Wed, 04 Sep 2013 12:53:26 -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.220.174.196 with SMTP id u4csp239149vcz; Wed, 4 Sep 2013 12:53:25 -0700 (PDT) X-Received: by 10.180.9.203 with SMTP id c11mr3377433wib.64.1378324404917; Wed, 04 Sep 2013 12:53:24 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id w7si9749512wje.104.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Sep 2013 12:53:24 -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 1VHJ8m-0007zu-7V for ; Wed, 04 Sep 2013 19:53:24 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 28500E94D9 for ; Wed, 4 Sep 2013 19:53:24 +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: 666 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 666: Improve bootloader handling support in image deployment Message-Id: <20130904195324.3181.64081.launchpad@ackee.canonical.com> Date: Wed, 04 Sep 2013 19:53:24 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16753"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 643523f3170ddeefc64afb81ab2ed33a51c6ebeb X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.51 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: Antonio Terceiro (terceiro) Related merge proposals: https://code.launchpad.net/~terceiro/lava-dispatcher/bootloadertype/+merge/183291 proposed by: Antonio Terceiro (terceiro) review: Approve - Tyler Baker (tyler-baker) ------------------------------------------------------------ revno: 666 [merge] committer: Antonio Terceiro branch nick: trunk timestamp: Wed 2013-09-04 16:19:19 -0300 message: Improve bootloader handling support in image deployment This patch makes two changes: - first, it addds a bootloadertype argument to the deploy_linaro_prebuilt action, which makes it possible to specify which bootloader is present in the image. This makes it possible for example to interact with uefi when using a prebuilt image, what previosly was only possible with hwpack+rootfs (for prebuilt image u-boot was always assumed) - second, the "bootloader" argument is being renamed to "bootloadertype", which is what it actually means. The `bootloader` device uses a "bootloader" argument that actually means the bootloader, i.e. you are supposed to pass the URL of a bootloader binary to it. modified: lava_dispatcher/actions/deploy.py lava_dispatcher/client/targetdevice.py lava_dispatcher/device/bootloader.py lava_dispatcher/device/fastmodel.py lava_dispatcher/device/ipmi_pxe.py lava_dispatcher/device/master.py lava_dispatcher/device/qemu.py lava_dispatcher/device/sdmux.py lava_dispatcher/device/target.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/deploy.py' --- lava_dispatcher/actions/deploy.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/actions/deploy.py 2013-08-30 22:15:05 +0000 @@ -54,7 +54,7 @@ 'rootfs': {'type': 'string', 'optional': True}, 'image': {'type': 'string', 'optional': True}, 'rootfstype': {'type': 'string', 'optional': True}, - 'bootloader': {'type': 'string', 'optional': True, 'default': 'u_boot'}, + 'bootloadertype': {'type': 'string', 'optional': True, 'default': 'u_boot'}, 'role': {'type': 'string', 'optional': True}, }, 'additionalProperties': False, @@ -71,9 +71,9 @@ elif 'image' not in parameters: raise ValueError('must specify image if not specifying a hwpack') - def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloader='u_boot'): + def run(self, hwpack=None, rootfs=None, image=None, rootfstype='ext3', bootloadertype='u_boot'): self.client.deploy_linaro( - hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloader=bootloader) + hwpack=hwpack, rootfs=rootfs, image=image, rootfstype=rootfstype, bootloadertype=bootloadertype) class cmd_deploy_linaro_android_image(BaseAction): === modified file 'lava_dispatcher/client/targetdevice.py' --- lava_dispatcher/client/targetdevice.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/client/targetdevice.py 2013-08-30 22:15:05 +0000 @@ -50,7 +50,7 @@ self.target_device.deploy_android(boot, system, data) def deploy_linaro(self, hwpack=None, rootfs=None, image=None, - rootfstype='ext3', bootloader='u_boot'): + rootfstype='ext3', bootloadertype='u_boot'): if image is None: if hwpack is None or rootfs is None: raise CriticalError( @@ -60,9 +60,9 @@ "cannot specify hwpack or rootfs when specifying image") if image is None: - self.target_device.deploy_linaro(hwpack, rootfs, bootloader) + self.target_device.deploy_linaro(hwpack, rootfs, bootloadertype) else: - self.target_device.deploy_linaro_prebuilt(image) + self.target_device.deploy_linaro_prebuilt(image, bootloadertype) def deploy_linaro_kernel(self, kernel, ramdisk=None, dtb=None, rootfs=None, bootloader=None, firmware=None, rootfstype='ext4', === modified file 'lava_dispatcher/device/bootloader.py' --- lava_dispatcher/device/bootloader.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/device/bootloader.py 2013-08-30 22:15:05 +0000 @@ -113,13 +113,13 @@ raise CriticalError("U-Boot is the only supported bootloader \ at this time") - def deploy_linaro(self, hwpack, rfs, bootloader): + def deploy_linaro(self, hwpack, rfs, bootloadertype): self._uboot_boot = False - super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloader) + super(BootloaderTarget, self).deploy_linaro(hwpack, rfs, bootloadertype) - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype): self._uboot_boot = False - super(BootloaderTarget, self).deploy_linaro_prebuilt(image) + super(BootloaderTarget, self).deploy_linaro_prebuilt(image, bootloadertype) def _inject_boot_cmds(self): if self._is_job_defined_boot_cmds(self.config.boot_cmds): === modified file 'lava_dispatcher/device/fastmodel.py' --- lava_dispatcher/device/fastmodel.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/device/fastmodel.py 2013-08-30 22:15:05 +0000 @@ -68,7 +68,7 @@ self._dtb = None self._initrd = None self._uefi = None - self._bootloader = 'u_boot' + self._bootloadertype = 'u_boot' def _customize_android(self): with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d: @@ -103,7 +103,7 @@ def _copy_needed_files_from_directory(self, subdir): odir = os.path.dirname(self._sd_image) - if self._bootloader == 'u_boot': + if self._bootloadertype == 'u_boot': # Extract the bootwrapper from the image if self.config.simulator_axf_files and self._axf is None: self._axf = self._copy_first_find_from_list(subdir, odir, @@ -120,14 +120,14 @@ if self.config.simulator_dtb and self._dtb is None: self._dtb = self._find_and_copy( subdir, odir, self.config.simulator_dtb) - elif self._bootloader == 'uefi': + elif self._bootloadertype == 'uefi': # Extract the uefi binary from the image if self.config.simulator_uefi and self._uefi is None: self._uefi = self._find_and_copy( subdir, odir, self.config.simulator_uefi) def _check_needed_files(self): - if self._bootloader == 'u_boot': + if self._bootloadertype == 'u_boot': # AXF is needed when we are not using UEFI if self._axf is None and self.config.simulator_axf_files: raise RuntimeError('No AXF found, %r' % @@ -144,7 +144,7 @@ if self._dtb is None and self.config.simulator_dtb: raise RuntimeError('No DTB found, %r' % self.config.simulator_dtb) - elif self._bootloader == 'uefi': + elif self._bootloadertype == 'uefi': # UEFI binary is needed when specified if self._uefi is None and self.config.simulator_uefi: raise RuntimeError('No UEFI binary found, %r' % @@ -167,14 +167,14 @@ self._customize_android() - def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'): + def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'): hwpack = download_image(hwpack, self.context, decompress=False) rootfs = download_image(rootfs, self.context, decompress=False) odir = os.path.dirname(rootfs) - self._bootloader = bootloader + self._bootloadertype = bootloadertype - generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloader) + generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloadertype) self._sd_image = '%s/sd.img' % odir self._copy_needed_files_from_directory(odir) @@ -183,8 +183,9 @@ self._customize_linux(self._sd_image) - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype): self._sd_image = download_image(image, self.context) + self._bootloadertype = bootloadertype self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm') self._copy_needed_files_from_partition(self.config.root_part, 'boot') === modified file 'lava_dispatcher/device/ipmi_pxe.py' --- lava_dispatcher/device/ipmi_pxe.py 2013-07-16 16:06:42 +0000 +++ lava_dispatcher/device/ipmi_pxe.py 2013-08-30 22:15:05 +0000 @@ -73,13 +73,13 @@ def power_off(self, proc): pass - def deploy_linaro(self, hwpack, rfs, bootloader): - image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader, + def deploy_linaro(self, hwpack, rfs, bootloadertype): + image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype, extra_boot_args='1', image_size='1G') self._customize_linux(image_file) self._deploy_image(image_file, '/dev/sda') - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype): image_file = download_image(image, self.context, self.scratch_dir) self._customize_linux(image_file) self._deploy_image(image_file, '/dev/sda') === modified file 'lava_dispatcher/device/master.py' --- lava_dispatcher/device/master.py 2013-09-03 22:17:25 +0000 +++ lava_dispatcher/device/master.py 2013-09-04 19:19:19 +0000 @@ -106,10 +106,10 @@ if self.config.power_off_cmd: self.context.run_command(self.config.power_off_cmd) - def deploy_linaro(self, hwpack, rfs, bootloader): + def deploy_linaro(self, hwpack, rfs, bootloadertype): self.boot_master_image() - image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloader) + image_file = generate_image(self, hwpack, rfs, self.scratch_dir, bootloadertype) (boot_tgz, root_tgz, data) = self._generate_tarballs(image_file) self._read_boot_cmds(boot_tgz=boot_tgz) @@ -149,7 +149,7 @@ _deploy_linaro_android_system(master, system_url) _deploy_linaro_android_data(master, data_url) - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype): self.boot_master_image() if self.context.job_data.get('health_check', False): === modified file 'lava_dispatcher/device/qemu.py' --- lava_dispatcher/device/qemu.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/device/qemu.py 2013-08-30 22:15:05 +0000 @@ -78,14 +78,14 @@ else: raise CriticalError("No kernel images to boot") - def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'): + def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype='u_boot'): odir = self.scratch_dir - self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloader) + self._sd_image = generate_image(self, hwpack, rootfs, odir, bootloadertype) self._customize_linux(self._sd_image) self.append_qemu_options(self.config.qemu_options.format( DISK_IMAGE=self._sd_image)) - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype='u_boot'): self._sd_image = download_image(image, self.context) self._customize_linux(self._sd_image) self.append_qemu_options(self.config.qemu_options.format( === modified file 'lava_dispatcher/device/sdmux.py' --- lava_dispatcher/device/sdmux.py 2013-07-16 16:04:07 +0000 +++ lava_dispatcher/device/sdmux.py 2013-08-30 22:15:05 +0000 @@ -88,12 +88,12 @@ if config.pre_connect_command: self.context.run_command(config.pre_connect_command) - def deploy_linaro(self, hwpack=None, rootfs=None, bootloader=None): + def deploy_linaro(self, hwpack=None, rootfs=None, bootloadertype=None): img = generate_image(self, hwpack, rootfs, self.scratch_dir) self._customize_linux(img) self._write_image(img) - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype=None): img = download_image(image, self.context) self._customize_linux(img) self._write_image(img) === modified file 'lava_dispatcher/device/target.py' --- lava_dispatcher/device/target.py 2013-08-28 14:55:50 +0000 +++ lava_dispatcher/device/target.py 2013-08-30 22:15:05 +0000 @@ -89,13 +89,13 @@ """ raise NotImplementedError('power_on') - def deploy_linaro(self, hwpack, rfs, bootloader): + def deploy_linaro(self, hwpack, rfs, bootloadertype): raise NotImplementedError('deploy_image') def deploy_android(self, boot, system, userdata): raise NotImplementedError('deploy_android_image') - def deploy_linaro_prebuilt(self, image): + def deploy_linaro_prebuilt(self, image, bootloadertype): raise NotImplementedError('deploy_linaro_prebuilt') def power_off(self, proc):