diff mbox

[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
State Accepted
Headers show

Commit Message

James Westby July 26, 2011, 3:36 p.m. UTC
------------------------------------------------------------
revno: 390
author: Bernhard Rosenkranzer <Bernhard.Rosenkranzer@linaro.org>
committer: James Westby <james.westby@linaro.org>
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
diff mbox

Patch

=== 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(