aboutsummaryrefslogtreecommitdiff
path: root/linaro_image_tools/media_create/__init__.py
diff options
context:
space:
mode:
authorjeremy.chang@linaro.org <>2011-03-30 23:36:05 +0800
committerjeremy.chang@linaro.org <>2011-03-30 23:36:05 +0800
commitd8d780f109343f9104aa0e7964caf02231c05e80 (patch)
treeadef1e42c08f0493ea7f10144357671b10f65418 /linaro_image_tools/media_create/__init__.py
parent43977b6d8982dc2da0ec1fda08be7ca84e8b6946 (diff)
Clean up the android code
Remove redundant code, android_boards.py and android_init.py Modify the import path in linaro-android-media-create due to rebased the trunk. Change the author of linaro-android-media-creat
Diffstat (limited to 'linaro_image_tools/media_create/__init__.py')
-rw-r--r--linaro_image_tools/media_create/__init__.py68
1 files changed, 68 insertions, 0 deletions
diff --git a/linaro_image_tools/media_create/__init__.py b/linaro_image_tools/media_create/__init__.py
index fbac542..63aec89 100644
--- a/linaro_image_tools/media_create/__init__.py
+++ b/linaro_image_tools/media_create/__init__.py
@@ -110,3 +110,71 @@ def get_args_parser():
action='store_true',
help='Align boot partition too (might break older x-loaders).')
return parser
+
+def get_android_args_parser():
+ """Get the ArgumentParser for the arguments given on the command line."""
+ parser = argparse.ArgumentParser()
+ group = parser.add_mutually_exclusive_group(required=True)
+ group.add_argument(
+ '--mmc', dest='device', help='The storage device to use.')
+ group.add_argument(
+ '--image_file', dest='device',
+ help='File where we should write the QEMU image.')
+ parser.add_argument(
+ '--dev', required=True, dest='board', choices=KNOWN_BOARDS,
+ help='Generate an SD card or image for the given board.')
+ parser.add_argument(
+ '--rootfs', default='ext4', choices=['ext2', 'ext3', 'ext4', 'btrfs'],
+ help='Type of filesystem to use for the rootfs')
+ parser.add_argument(
+ '--rfs_label', default='rootfs',
+ help='Label to use for the root filesystem.')
+ parser.add_argument(
+ '--boot_label', default='boot',
+ help='Label to use for the boot filesystem.')
+ parser.add_argument(
+ '--swap_file', type=int,
+ help='Create a swap file of the given size (in MBs).')
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument(
+ '--live', dest='is_live', action='store_true',
+ help=('Create boot command for casper/live images; if this is not '
+ 'provided the UUID for the rootfs is used as the root= option'))
+ group.add_argument(
+ '--live-256m', dest='is_lowmem', action=Live256MegsAction,
+ help=('Create boot command for casper/live images; adds '
+ 'only-ubiquity option to allow use of live installer on '
+ 'boards with 256M memory - like beagle.'))
+ parser.add_argument(
+ '--console', action='append', dest='consoles', default=[],
+ help=('Add a console to kernel boot parameter; this parameter can be '
+ 'defined multiple times.'))
+ parser.add_argument(
+ '--image_size', default='2G',
+ help=('The image size, specified in mega/giga bytes (e.g. 3000M or '
+ '3G); use with --image_file only'))
+
+ parser.add_argument(
+ '--system', default='system.tar.bz2', required=True,
+ help=('The tarball containing the Android system paritition'))
+ parser.add_argument(
+ '--userdata', default='userdata.tar.bz2', required=True,
+ help=('The tarball containing the Android data paritition'))
+ parser.add_argument(
+ '--root', default='root.tar.bz2', required=True,
+ help=('The tarball containing the Android root partition'))
+
+ parser.add_argument(
+ '--no-rootfs', dest='should_format_rootfs', action='store_false',
+ help='Do not deploy the root filesystem.')
+ parser.add_argument(
+ '--no-bootfs', dest='should_format_bootfs', action='store_false',
+ help='Do not deploy the boot filesystem.')
+ parser.add_argument(
+ '--no-part', dest='should_create_partitions', action='store_false',
+ help='Reuse existing partitions on the given media.')
+ parser.add_argument(
+ '--align-boot-part', dest='should_align_boot_part',
+ action='store_true',
+ help='Align boot partition too (might break older x-loaders).')
+ return parser