From patchwork Tue Jun 4 16:30:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 17531 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 926C225A2B for ; Tue, 4 Jun 2013 16:30:29 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id 1sf491039qee.2 for ; Tue, 04 Jun 2013 09:30:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :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=4cjKqEFcVFGTpxci6x6KEaJ2kdUKHhBdxeAIXZgNtSk=; b=jfTbijMerU6mKNqqfL8S0E8GpbinINao9zLHLd++g4PYEsY/pj7v/i0G9kuA5Uwgn4 i/qZB4Bpv1dPRAUQXbIwDtRv2zAdpLoR7jf9mSRBu6XqmpyoOPLILb65K8SFSR6K/fPC 0IGmg4qLTIYhAQBoMdlCKrYexGMtRkxkI64ge3rz6U+/nAT9f11PNq3NlIBJFSr3J679 7l44Bq65p7TeloQJj3Udl96g2C4gYe+Pp1qHj4OlpVMNb1I0MPLvOb3gZF2rMJJ9yrxQ vBrxO6Z1ewH4J1/mritgWEBdGp73rUEm0PRKTvlgCqIYUHgBiMlu0/c9WFm/YX38U+M+ H4qQ== X-Received: by 10.224.200.202 with SMTP id ex10mr16783715qab.8.1370363429172; Tue, 04 Jun 2013 09:30:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.196 with SMTP id 4ls361469qeg.96.gmail; Tue, 04 Jun 2013 09:30:28 -0700 (PDT) X-Received: by 10.58.50.7 with SMTP id y7mr19276525ven.24.1370363428843; Tue, 04 Jun 2013 09:30:28 -0700 (PDT) Received: from mail-vb0-x229.google.com (mail-vb0-x229.google.com [2607:f8b0:400c:c02::229]) by mx.google.com with ESMTPS id sz6si3899657vdc.153.2013.06.04.09.30.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Jun 2013 09:30:28 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::229 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:c02::229; Received: by mail-vb0-f41.google.com with SMTP id p14so329617vbm.14 for ; Tue, 04 Jun 2013 09:30:28 -0700 (PDT) X-Received: by 10.52.157.138 with SMTP id wm10mr16109988vdb.57.1370363428658; Tue, 04 Jun 2013 09:30:28 -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.221.10.206 with SMTP id pb14csp133987vcb; Tue, 4 Jun 2013 09:30:27 -0700 (PDT) X-Received: by 10.180.184.2 with SMTP id eq2mr2245097wic.50.1370363426755; Tue, 04 Jun 2013 09:30:26 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id l5si23012171wjx.58.2013.06.04.09.30.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Jun 2013 09:30:26 -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 1Uju7u-0007xH-58 for ; Tue, 04 Jun 2013 16:30:26 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 17FD3E03C7 for ; Tue, 4 Jun 2013 16:30:26 +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: 618 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 618: Fixes for b.L fastmodels Message-Id: <20130604163026.26148.79871.launchpad@ackee.canonical.com> Date: Tue, 04 Jun 2013 16:30:26 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16660"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: bdd716d01fd6785e7a9c60d9fc64c731ee1652a8 X-Gm-Message-State: ALoCoQktf7R+0/ZzXR0eLeGV61h2ISeT1evzvyDTm+fYELm3pR2pY1rrNQRXFZGEDSDWQ/eNuB20 X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::229 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) Tyler Baker (tyler-baker) Related merge proposals: https://code.launchpad.net/~tyler-baker/lava-dispatcher/fastmodels-semihosting-fix-next/+merge/167332 proposed by: Tyler Baker (tyler-baker) review: Approve - Dave Pigott (dpigott) https://code.launchpad.net/~terceiro/lava-dispatcher/fastmodels-semihosting-fix/+merge/161258 proposed by: Antonio Terceiro (terceiro) ------------------------------------------------------------ revno: 618 [merge] committer: Tyler Baker branch nick: lava-dispatcher timestamp: Tue 2013-06-04 09:29:01 -0700 message: Fixes for b.L fastmodels modified: lava_dispatcher/config.py lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf lava_dispatcher/device/fastmodel.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/config.py' --- lava_dispatcher/config.py 2013-05-23 11:08:00 +0000 +++ lava_dispatcher/config.py 2013-06-04 16:00:29 +0000 @@ -83,6 +83,10 @@ simulator_version_command = schema.StringOption() simulator_command = schema.StringOption() simulator_axf_files = schema.ListOption() + simulator_kernel = schema.StringOption(default=None) + simulator_initrd = schema.StringOption(default=None) + simulator_dtb = schema.StringOption(default=None) + simulator_uefi = schema.StringOption(default=None) android_disable_suspend = schema.BoolOption(default=True) android_adb_over_usb = schema.BoolOption(default=False) === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf 2013-04-24 05:15:37 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf 2013-06-04 16:00:29 +0000 @@ -16,6 +16,12 @@ simulator_axf_files = img.axf linux-system-ISW.axf + rtsm/linux-system-semi.axf + +simulator_kernel = vmlinuz.* +simulator_initrd = initrd.* +simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb +simulator_uefi = uefi_rtsm_ve-ca15.bin license_file = 8224@localhost sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4 @@ -29,6 +35,9 @@ motherboard.hostbridge.userNetPorts motherboard.smsc_91c111.enabled motherboard.hostbridge.userNetworking + motherboard.flashloader0.fname + motherboard.flashloader1.fname + motherboard.flashloader1.fnameWrite coretile.cache_state_modelled coretile.cluster0.cpu0.semihosting-enable coretile.cluster0.cpu0.semihosting-cmd_line @@ -44,6 +53,15 @@ default = 1 allowed = 0,1 +[motherboard.flashloader0.fname] +default = {UEFI} + +[motherboard.flashloader1.fname] +default = "uefi-vars.fd" + +[motherboard.flashloader1.fnameWrite] +default = uefi-vars.fd + [coretile.cache_state_modelled] default = 0 allowed = 0,1 @@ -53,3 +71,4 @@ allowed = 0,1 [coretile.cluster0.cpu0.semihosting-cmd_line] +default = "--kernel {KERNEL} --dtb {DTB} --initrd {INITRD} -- console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M" === modified file 'lava_dispatcher/device/fastmodel.py' --- lava_dispatcher/device/fastmodel.py 2013-03-25 20:23:35 +0000 +++ lava_dispatcher/device/fastmodel.py 2013-06-04 16:00:29 +0000 @@ -26,6 +26,7 @@ import shutil import stat import subprocess +import re import lava_dispatcher.device.boot_options as boot_options @@ -62,6 +63,12 @@ self._sim_proc = None + self._axf = None + self._kernel = None + self._dtb = None + self._initrd = None + self._uefi = None + def _customize_android(self): with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d: wallpaper = '%s/%s' % (d, self.ANDROID_WALLPAPER) @@ -78,20 +85,68 @@ self.deployment_data = Target.android_deployment_data - def _copy_axf(self, partno, subdir): - self._axf = None + def _copy_needed_files_from_partition(self, partno, subdir): with image_partition_mounted(self._sd_image, partno) as mntdir: subdir = os.path.join(mntdir, subdir) + self._copy_needed_files_from_directory(subdir) + + def _copy_needed_files_from_directory(self, subdir): + odir = os.path.dirname(self._sd_image) + + if self._axf is None: for fname in self.config.simulator_axf_files: src = os.path.join(subdir, fname) if os.path.exists(src): - odir = os.path.dirname(self._sd_image) self._axf = '%s/%s' % (odir, os.path.split(src)[1]) - shutil.copyfile(src, self._axf) + if src != self._axf: + shutil.copyfile(src, self._axf) break - if not self._axf: - raise RuntimeError('No AXF found, %r' % os.listdir(subdir)) + if self.config.simulator_kernel: + self._copy_boot_files_from_directory(odir, subdir) + + def _copy_boot_files_from_directory(self, odir, subdir): + # TODO: Optimize this loop + for root, dirs, files in os.walk(subdir): + for file in files: + if re.match(self.config.simulator_kernel, file) and self._kernel is None: + self._kernel = os.path.join(odir, file) + if odir != subdir: + kernel = os.path.join(subdir, file) + shututil.copyfile(kernel, self._kernel) + elif re.match(self.config.simulator_initrd, file) and self._initrd is None: + self._initrd = os.path.join(odir, file) + if odir != subdir: + initrd = os.path.join(subdir, file) + shutil.copyfile(initrd, self._initrd) + elif re.match(self.config.simulator_dtb, file) and self._dtb is None: + self._dtb = os.path.join(odir, file) + if odir != subdir: + dtb = os.path.join(subdir, file) + shutil.copyfile(dtb, self._dtb) + elif re.match(self.config.simulator_uefi, file) and self._uefi is None: + self._uefi = os.path.join(odir, file) + if odir != subdir: + uefi = os.path.join(subdir, file) + shutil.copyfile(uefi, self._uefi) + + def _check_needed_files(self): + # AXF is needed in all cases + if not self._axf: + raise RuntimeError('No AXF found, %r' % + self.config.simulator_axf_files) + # Kernel is needed only for b.L models + if self._kernel is None and self.config.simulator_kernel: + raise RuntimeError('No kernel found, %r' % + self.config.simulator_kernel) + # Initrd is needed only for b.L models + if self._initrd is None and self.config.simulator_initrd: + raise RuntimeError('No initrd found, %r' % + self.config.simulator_initrd) + # DTB is needed only for b.L models + if self._dtb is None and self.config.simulator_dtb: + raise RuntimeError('No initrd found, %r' % + self.config.simulator_dtb) def deploy_android(self, boot, system, data): logging.info("Deploying Android on %s" % self.config.hostname) @@ -106,7 +161,7 @@ self.context, 'vexpress-a9', self._boot, self._data, self._system, self._sd_image ) - self._copy_axf(self.config.boot_part, '') + self._copy_needed_files_from_partition(self.config.boot_part, '') self._customize_android() @@ -117,20 +172,18 @@ generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloader) self._sd_image = '%s/sd.img' % odir - self._axf = None - for f in self.config.simulator_axf_files: - fname = os.path.join(odir, f) - if os.path.exists(fname): - self._axf = fname - break - if not self._axf: - raise RuntimeError('No AXF found, %r' % os.listdir(odir)) + + self._copy_needed_files_from_directory(odir) + self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm') + self._copy_needed_files_from_partition(self.config.root_part, 'boot') self._customize_linux(self._sd_image) def deploy_linaro_prebuilt(self, image): self._sd_image = download_image(image, self.context) - self._copy_axf(self.config.root_part, 'boot') + + self._copy_needed_files_from_partition(self.config.boot_part, 'rtsm') + self._copy_needed_files_from_partition(self.config.root_part, 'boot') self._customize_linux(self._sd_image) @@ -158,11 +211,27 @@ os.chmod(d, stat.S_IRWXG | stat.S_IRWXU) os.chmod(self._sd_image, stat.S_IRWXG | stat.S_IRWXU) os.chmod(self._axf, stat.S_IRWXG | stat.S_IRWXU) + if self._kernel: + os.chmod(self._kernel, stat.S_IRWXG | stat.S_IRWXU) + if self._dtb: + os.chmod(self._dtb, stat.S_IRWXG | stat.S_IRWXU) + if self._initrd: + os.chmod(self._initrd, stat.S_IRWXG | stat.S_IRWXU) + if self._uefi: + os.chmod(self._uefi, stat.S_IRWXG | stat.S_IRWXU) #lmc ignores the parent directories group owner st = os.stat(d) os.chown(self._axf, st.st_uid, st.st_gid) os.chown(self._sd_image, st.st_uid, st.st_gid) + if self._kernel: + os.chown(self._kernel, st.st_uid, st.st_gid) + if self._dtb: + os.chown(self._dtb, st.st_uid, st.st_gid) + if self._initrd: + os.chown(self._initrd, st.st_uid, st.st_gid) + if self._uefi: + os.chown(self._uefi, st.st_uid, st.st_gid) def power_off(self, proc): super(FastModelTarget, self).power_off(proc) @@ -189,12 +258,15 @@ logging.warning("device was still on, shutting down") self.power_off(None) + self._check_needed_files() + self._fix_perms() options = boot_options.as_string(self, join_pattern=' -C %s=%s') - sim_cmd = self.config.simulator_command.format( - AXF=self._axf, IMG=self._sd_image) - sim_cmd = '%s %s' % (sim_cmd, options) + sim_cmd = '%s %s' % (self.config.simulator_command, options) + sim_cmd = sim_cmd.format( + AXF=self._axf, IMG=self._sd_image, KERNEL=self._kernel, + DTB=self._dtb, INITRD=self._initrd, UEFI=self._uefi) # the simulator proc only has stdout/stderr about the simulator # we hook up into a telnet port which emulates a serial console