From patchwork Tue Jul 26 15:36:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Westby X-Patchwork-Id: 3155 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 3AF6424142 for ; Tue, 26 Jul 2011 15:36:33 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id E2481A18787 for ; Tue, 26 Jul 2011 15:36:32 +0000 (UTC) Received: by qyk30 with SMTP id 30so379061qyk.11 for ; Tue, 26 Jul 2011 08:36:32 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr781673qci.114.1311694592354; Tue, 26 Jul 2011 08:36:32 -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.229.217.78 with SMTP id hl14cs116847qcb; Tue, 26 Jul 2011 08:36:32 -0700 (PDT) Received: by 10.227.11.134 with SMTP id t6mr5178004wbt.21.1311694591339; Tue, 26 Jul 2011 08:36:31 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id c13si1116606wbh.77.2011.07.26.08.36.30; Tue, 26 Jul 2011 08:36:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QljgM-0008S8-Mk for ; Tue, 26 Jul 2011 15:36:30 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id A81842E8047 for ; Tue, 26 Jul 2011 15:36:30 +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: 390 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 390: Install the imx.53 bootloader when using Android. Message-Id: <20110726153630.4538.87457.launchpad@loganberry.canonical.com> Date: Tue, 26 Jul 2011 15:36:30 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13503"; Instance="initZopeless config overlay" X-Launchpad-Hash: e953228bd928120a2657809e16c0c73f311274a2 ------------------------------------------------------------ revno: 390 author: Bernhard Rosenkranzer committer: James Westby branch nick: trunk timestamp: Tue 2011-07-26 16:35:22 +0100 message: Install the imx.53 bootloader when using Android. modified: linaro-android-media-create linaro_image_tools/media_create/android_boards.py linaro_image_tools/media_create/partitions.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-android-media-create' --- linaro-android-media-create 2011-06-30 12:09:46 +0000 +++ linaro-android-media-create 2011-07-26 15:35:22 +0000 @@ -142,6 +142,7 @@ board_config.populate_raw_partition(args.device, BOOT_DIR) populate_partition(BOOT_DIR + "/boot", BOOT_DISK, boot_partition) board_config.populate_boot_script(boot_partition, BOOT_DISK, args.consoles) + board_config.install_boot_loader(args.device, BOOT_DISK) populate_partition(SYSTEM_DIR + "/system", SYSTEM_DISK, system_partition) populate_partition(DATA_DIR + "/data", DATA_DISK, data_partition) print "Done creating Linaro Android image on %s" % args.device === modified file 'linaro_image_tools/media_create/android_boards.py' --- linaro_image_tools/media_create/android_boards.py 2011-07-25 16:48:37 +0000 +++ linaro_image_tools/media_create/android_boards.py 2011-07-26 15:35:22 +0000 @@ -34,7 +34,8 @@ from linaro_image_tools.media_create.boards import ( align_up, align_partition, - make_boot_script + make_boot_script, + install_mx5_boot_loader, ) from linaro_image_tools import cmd_runner @@ -160,6 +161,9 @@ def populate_raw_partition(cls, media, boot_dir): super(AndroidBoardConfig, cls).populate_raw_partition(boot_dir, media) + @classmethod + def install_boot_loader(cls, boot_partition, boot_device_or_file): + pass class AndroidOmapConfig(AndroidBoardConfig): pass @@ -219,7 +223,22 @@ Mx53LoCoConfig.serial_tty) android_specific_args = 'init=/init androidboot.console=%s' % ( Mx53LoCoConfig.serial_tty) - mmc_part_offset = 0 + + @classmethod + def get_sfdisk_cmd(cls, should_align_boot_part=False): + loader_start, loader_end, loader_len = align_partition( + 1, cls.LOADER_MIN_SIZE_S, 1, PART_ALIGN_S) + + command = super(AndroidMx53LoCoConfig, cls).get_sfdisk_cmd( + should_align_boot_part=True, start_addr=loader_end, + extra_part=True) + + return '%s,%s,0xDA\n%s' % ( + loader_start, loader_len, command) + + @classmethod + def install_boot_loader(cls, boot_partition, boot_device_or_file): + install_mx5_boot_loader(os.path.join(boot_device_or_file, "u-boot.bin"), boot_partition, cls.LOADER_MIN_SIZE_S) android_board_configs = { 'beagle': AndroidBeagleConfig, === modified file 'linaro_image_tools/media_create/partitions.py' --- linaro_image_tools/media_create/partitions.py 2011-07-26 12:10:08 +0000 +++ linaro_image_tools/media_create/partitions.py 2011-07-26 15:35:22 +0000 @@ -372,8 +372,14 @@ media.path, 1 + board_config.mmc_part_offset) system_partition = _get_device_file_for_partition_number( media.path, 2 + board_config.mmc_part_offset) - cache_partition = _get_device_file_for_partition_number( - media.path, 3 + board_config.mmc_part_offset) + if board_config.mmc_part_offset != 1: + cache_partition = _get_device_file_for_partition_number( + media.path, 3 + board_config.mmc_part_offset) + else: + # In the current setup, partition 4 is always the + # extended partition container, so we need to skip 4 + cache_partition = _get_device_file_for_partition_number( + media.path, 5) data_partition = _get_device_file_for_partition_number( media.path, 5 + board_config.mmc_part_offset) sdcard_partition = _get_device_file_for_partition_number(