From patchwork Wed Oct 17 16:11:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Casagrande X-Patchwork-Id: 12319 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 A9A2923F62 for ; Wed, 17 Oct 2012 16:11:16 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id EE9D0A19490 for ; Wed, 17 Oct 2012 16:11:15 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11659265iej.11 for ; Wed, 17 Oct 2012 09:11:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type: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; bh=iu1C5k1M6p/oh2D3takcaqBWbihSoP0ZGNFPK6zn8vs=; b=fFf1e7bSRhVGaDkaBC5bk4RkwhB+ICYdVtI57qJ8X4pkT1bG8KX+gVOJlhtSSGIb7y 2YDFV7XsOsPoQInxpee3i4MZRG7Lw4hfk7QVNf86/5ACT0GMb9mCf384ogtFeXN3Sonm KgWsY6TuOrfwtgeUc+wbMJkkBvppuq8niVzXM10tVDjJZMqXK632hTQ+PlySaH2hM7G8 qkgNljyI6+20DWF9gK++/2QiZSUb5CF03Ce5u54rai+aQNcsP/mEfS6+XcmGPPNqGFk6 2a9HkUGJwLlBWS/CjA9X1Nw/U0nNYBTG9PBtDYmhf0YlJ5bZkdL0F7ID7X3GqvKPwPby Yomw== Received: by 10.50.161.169 with SMTP id xt9mr2022352igb.62.1350490275283; Wed, 17 Oct 2012 09:11:15 -0700 (PDT) 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.50.67.148 with SMTP id n20csp920242igt; Wed, 17 Oct 2012 09:11:14 -0700 (PDT) Received: by 10.216.137.94 with SMTP id x72mr10975580wei.187.1350490272231; Wed, 17 Oct 2012 09:11:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id l64si24547672wej.161.2012.10.17.09.11.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 09:11:12 -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; 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 1TOWD8-0003yl-T7 for ; Wed, 17 Oct 2012 16:11:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B4E69E01A6 for ; Wed, 17 Oct 2012 16:11:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 578 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 578: Added dtb_files support to hwpack config converter. Message-Id: <20121017161110.6223.97207.launchpad@ackee.canonical.com> Date: Wed, 17 Oct 2012 16:11:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16152"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: ff76b6daf0ec27c03f03c1640e0736167c6aac77 X-Gm-Message-State: ALoCoQnGrto6MVP58GL3bU8M8BNcAcBJ1j4mBYXcZlusXaXpNcZRieXqPiCKsLn4zS3xx2rEmOYo Merge authors: Milo Casagrande (milo) Related merge proposals: https://code.launchpad.net/~milo/linaro-image-tools/hwpack-converter-dtb-files/+merge/130137 proposed by: Milo Casagrande (milo) review: Approve - James Tunnicliffe (dooferlad) ------------------------------------------------------------ revno: 578 [merge] committer: Milo Casagrande branch nick: trunk timestamp: Wed 2012-10-17 18:10:50 +0200 message: Added dtb_files support to hwpack config converter. modified: linaro_image_tools/hwpack/hwpack_convert.py linaro_image_tools/hwpack/tests/test_hwpack_converter.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro_image_tools/hwpack/hwpack_convert.py' --- linaro_image_tools/hwpack/hwpack_convert.py 2012-07-20 08:19:11 +0000 +++ linaro_image_tools/hwpack/hwpack_convert.py 2012-10-17 14:53:24 +0000 @@ -39,6 +39,8 @@ FILE_FIELD, IN_BOOT_PART_FIELD, DD_FIELD, + DTB_FILE_FIELD, + DTB_FILES_FIELD, ENV_DD_FIELD, SPL_IN_BOOT_PART_FIELD, SPL_DD_FIELD, @@ -80,6 +82,9 @@ SPL_KEYS = [SPL_IN_BOOT_PART_FIELD, SPL_DD_FIELD, SPL_PACKAGE_FIELD, SPL_FILE_FIELD, ENV_DD_FIELD] +# The default name used for renaming dtb file +DEFAULT_DTB_NAME = 'board.dtb' + logger = logging.getLogger("linaro_hwpack_converter") @@ -125,6 +130,8 @@ self.spl = {} # The list of packages that should be installed. self.assume_installed = [] + # The dtb_files section + self.dtb_files = [] def _parse(self): """Parses the config file and stores its values.""" @@ -181,6 +188,10 @@ self.assume_installed, value) continue + elif key == DTB_FILE_FIELD: + self.dtb_files.append({DEFAULT_DTB_NAME: + value}) + continue elif key == INCLUDE_DEBS_OLD: key = INCLUDE_DEBS_FIELD self.hwpack[key] = value @@ -258,6 +269,9 @@ if self.sources: sources = {SOURCES_FIELD: self.sources} converted += dump(sources) + if self.dtb_files: + dtb = {DTB_FILES_FIELD: self.dtb_files} + converted += dump(dtb) if self.bootloaders or self.extra_boot_options or self.spl: # The bootloaders section in the new YAML file is a dictionary # containing a dictionary which can contains also other === modified file 'linaro_image_tools/hwpack/tests/test_hwpack_converter.py' --- linaro_image_tools/hwpack/tests/test_hwpack_converter.py 2012-07-20 08:19:11 +0000 +++ linaro_image_tools/hwpack/tests/test_hwpack_converter.py 2012-10-17 14:53:24 +0000 @@ -154,3 +154,15 @@ converter = HwpackConverter(input_file, output_file) converter._parse() self.assertEqual(out_format, str(converter)) + + def test_dtb_file(self): + """Test the dtb_file conversion.""" + ini_format = ("[hwpack]\nformat=2.0\ndtb_file=boot/a-*-path/file.dtb") + out_format = ("format: '3.0'\ndtb_files:\n- board.dtb: " + "boot/a-*-path/file.dtb\n") + input_file = self.useFixture(CreateTempFileFixture(ini_format)).\ + get_file_name() + output_file = self.useFixture(CreateTempFileFixture()).get_file_name() + converter = HwpackConverter(input_file, output_file) + converter._parse() + self.assertEqual(out_format, str(converter))