aboutsummaryrefslogtreecommitdiff
path: root/linaro-media-create
diff options
context:
space:
mode:
authorSemen Protsenko <semen.protsenko@linaro.org>2014-06-04 11:11:04 +0100
committerFathi Boudra <fathi.boudra@linaro.org>2014-06-14 12:21:00 +0000
commit0c28539742ead845da3c08bae63be5af9a71d0d7 (patch)
treec034a8cd2d482a679763ea6245a36270cbdb389c /linaro-media-create
parent23231928b4e6d1d6df985defe9de4ee0e0f04db1 (diff)
downloadlinaro-image-tools-0c28539742ead845da3c08bae63be5af9a71d0d7.tar.gz
linaro-media-create: add GPT support (--part-table option)
Now user can choose partition table between MBR (default) or GPT, using the option "--part-table". For GPT partitioning, "sgdisk" tool is required. Call-chain of interest (before this patch): linaro-media-create: __main__() -> linaro_image_tools/media_create/partitions.py: setup_partitions() -> linaro_image_tools/media_create/partitions.py: create_partitions() -> linaro_image_tools/media_create/partitions.py: run_sfdisk_commands() The same operation can be done manually as follows: $ dd if=/dev/zero of=linaro.img bs=1M count=2k $ /sbin/sgdisk -n 1:-:200m -t 1:EF00 linaro.img $ /sbin/sgdisk -n 2:-:- -t 2:8300 linaro.img $ sudo kpartx -a linaro.img $ sudo mkfs.vfat -F32 -s 2 /dev/mapper/loop0p1 $ sudo mkfs.ext4 /dev/mapper/loop0p2 $ sudo kpartx -d linaro.img Change-Id: Iba274c18bdb1f618124c8cc2784f233b049de7f0 Signed-off-by: Semen Protsenko <semen.protsenko@linaro.org>
Diffstat (limited to 'linaro-media-create')
-rwxr-xr-xlinaro-media-create5
1 files changed, 3 insertions, 2 deletions
diff --git a/linaro-media-create b/linaro-media-create
index ba3984f..727c8ff 100755
--- a/linaro-media-create
+++ b/linaro-media-create
@@ -94,7 +94,7 @@ def cleanup_tempdir():
def ensure_required_commands(args):
"""Ensure we have the commands that we know are going to be used."""
required_commands = [
- 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted', 'gpg', 'sha1sum']
+ 'mkfs.vfat', 'sfdisk', 'mkimage', 'parted', 'gpg', 'sha1sum', 'sgdisk']
if not is_arm_host():
required_commands.append('qemu-arm-static')
if args.rootfs in ['btrfs', 'ext2', 'ext3', 'ext4']:
@@ -241,7 +241,8 @@ if __name__ == '__main__':
boot_partition, root_partition = setup_partitions(
board_config, media, args.image_size, args.boot_label, args.rfs_label,
args.rootfs, args.should_create_partitions, args.should_format_bootfs,
- args.should_format_rootfs, args.should_align_boot_part)
+ args.should_format_rootfs, args.should_align_boot_part,
+ args.part_table)
uuid = get_uuid(root_partition)
# In case we're only extracting the kernel packages, avoid