=== modified file 'linaro-media-create'
@@ -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'
@@ -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'
@@ -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'
@@ -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):