From patchwork Thu Apr 19 10:35:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Tunnicliffe X-Patchwork-Id: 7943 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 8EE7423E49 for ; Thu, 19 Apr 2012 10:35:19 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 343C9A188DE for ; Thu, 19 Apr 2012 10:35:19 +0000 (UTC) Received: by iage36 with SMTP id e36so16070437iag.11 for ; Thu, 19 Apr 2012 03:35:18 -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=kWJEMv4ZKsMsTE/lpkShASv6dX9GcMahVTFLuph6caE=; b=MXdvcJGQ1Xz3n1LFAoyIKDYwSAfiKNyi/D/O0Mr4RQIcK0e6IXiO3mPMQ//oWBxdjr jjRFQ9dtmxzTR1e574+UgeF4Nx0QivSxyyEoAdFnaxZkST6BR46rpcim0BEQeI8s67vk xqhZlNTe+0G4IFF96qR8G1QpVTo7tXtn9ASQ6qQvvXfOIQLyN/ATciwnYoj85Qp9GR50 84mEZaJlLobZvioJ+1xmlE7busLDtEt+vayChKy5Wn6GO8MDl/wml+ghaN+hv/0g3+Pl zaihIjQ9sxox1DwCszwSyrFK9He+95Wg5Br+Sz4u/87kOkEJWUNEYw4yF1satHvRJXtW FiPg== Received: by 10.50.154.167 with SMTP id vp7mr1269581igb.55.1334831718592; Thu, 19 Apr 2012 03:35:18 -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.231.137.198 with SMTP id x6csp279762ibt; Thu, 19 Apr 2012 03:35:17 -0700 (PDT) Received: by 10.180.107.101 with SMTP id hb5mr4002446wib.7.1334831716897; Thu, 19 Apr 2012 03:35:16 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id o7si2003499wic.18.2012.04.19.03.35.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Apr 2012 03:35: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; 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 1SKoho-0001dA-8g for ; Thu, 19 Apr 2012 10:35:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 399B6E20D0 for ; Thu, 19 Apr 2012 10:35:16 +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: 509 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 509: Merge: Adding mmc_device_id to be parsed from mmc_id and be used by flash-kernel Message-Id: <20120419103516.26331.37622.launchpad@ackee.canonical.com> Date: Thu, 19 Apr 2012 10:35:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15108"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 7c3b0219fc64542d0998fc12830bb8111c7a798b X-Gm-Message-State: ALoCoQkoESmcHYn7Bg6ppgdowNk2OS/NHuYI1G/4nK2vjqyY0x/x4YFwwV3MV54KDDEm6WmuEf7/ Merge authors: Ricardo Salveti (rsalveti) Related merge proposals: https://code.launchpad.net/~rsalveti/linaro-image-tools/mmc_device_id/+merge/102611 proposed by: Ricardo Salveti (rsalveti) review: Approve - James Tunnicliffe (dooferlad) ------------------------------------------------------------ revno: 509 [merge] committer: James Tunnicliffe branch nick: trunk timestamp: Thu 2012-04-19 11:33:20 +0100 message: Merge: Adding mmc_device_id to be parsed from mmc_id and be used by flash-kernel modified: linaro-media-create linaro_image_tools/media_create/boards.py linaro_image_tools/media_create/rootfs.py linaro_image_tools/media_create/tests/test_media_create.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-media-create' --- linaro-media-create 2012-04-18 13:26:25 +0000 +++ linaro-media-create 2012-04-19 01:12:10 +0000 @@ -195,6 +195,7 @@ create_swap = True populate_rootfs(ROOTFS_DIR, ROOT_DISK, root_partition, args.rootfs, rootfs_uuid, create_swap, str(args.swap_file), - board_config.mmc_part_offset, board_config) + board_config.mmc_device_id, board_config.mmc_part_offset, + board_config) print "Done creating Linaro image on %s" % media.path === modified file 'linaro_image_tools/media_create/boards.py' --- linaro_image_tools/media_create/boards.py 2012-04-18 14:25:33 +0000 +++ linaro_image_tools/media_create/boards.py 2012-04-19 01:12:10 +0000 @@ -206,6 +206,7 @@ env_dd = False fatload_command = 'fatload' mmc_option = '0:1' + mmc_device_id = 0 mmc_part_offset = 0 uimage_path = '' fat_size = 32 @@ -347,6 +348,7 @@ cls.mmc_option = cls.get_metadata_field('mmc_id') if cls.mmc_option is not None: + cls.mmc_device_id = int(cls.mmc_option.split(':')[0]) cls.mmc_part_offset = int(cls.mmc_option.split(':')[1]) - 1 boot_min_size = cls.get_metadata_field('boot_min_size') === modified file 'linaro_image_tools/media_create/rootfs.py' --- linaro_image_tools/media_create/rootfs.py 2011-10-19 13:59:30 +0000 +++ linaro_image_tools/media_create/rootfs.py 2012-04-19 01:12:10 +0000 @@ -43,7 +43,7 @@ def populate_rootfs(content_dir, root_disk, partition, rootfs_type, rootfs_uuid, should_create_swap, swap_size, - partition_offset, board_config=None): + mmc_device_id, partition_offset, board_config=None): """Populate the rootfs and make the necessary tweaks to make it usable. This consists of: @@ -87,7 +87,8 @@ append_to_fstab(root_disk, fstab_additions) print "\nCreating /etc/flash-kernel.conf\n" - create_flash_kernel_config(root_disk, 1 + partition_offset) + create_flash_kernel_config( + root_disk, mmc_device_id, 1 + partition_offset) if board_config is not None: print "\nUpdating /etc/network/interfaces\n" @@ -114,15 +115,16 @@ write_data_to_protected_file(if_path, config) -def create_flash_kernel_config(root_disk, boot_partition_number): +def create_flash_kernel_config(root_disk, mmc_device_id, boot_partition_number): """Create a flash-kernel.conf file under root_disk/etc. Uses the given partition number to figure out the boot partition. """ - target_boot_dev = '/dev/mmcblk0p%s' % boot_partition_number + target_boot_dev = '/dev/mmcblk%dp%s' % ( + mmc_device_id, boot_partition_number) flash_kernel = os.path.join(root_disk, 'etc', 'flash-kernel.conf') write_data_to_protected_file( - flash_kernel, "UBOOT_PART=%s" % target_boot_dev) + flash_kernel, "UBOOT_PART=%s\n" % target_boot_dev) def _list_files(directory): === modified file 'linaro_image_tools/media_create/tests/test_media_create.py' --- linaro_image_tools/media_create/tests/test_media_create.py 2012-03-21 14:14:56 +0000 +++ linaro_image_tools/media_create/tests/test_media_create.py 2012-04-19 01:12:10 +0000 @@ -389,6 +389,7 @@ pass config.set_metadata('ahwpack.tar.gz') self.assertEquals(data_to_set, config.mmc_option) + self.assertEquals(0, config.mmc_device_id) self.assertEquals(0, config.mmc_part_offset) def test_sets_boot_min_size(self):