Merge lp:~milo/linaro-image-tools/hwpack-args into lp:linaro-image-tools/11.11

Proposed by Milo Casagrande
Status: Merged
Approved by: Данило Шеган
Approved revision: 600
Merged at revision: 596
Proposed branch: lp:~milo/linaro-image-tools/hwpack-args
Merge into: lp:linaro-image-tools/11.11
Prerequisite: lp:~milo/linaro-image-tools/android-boards
Diff against target: 97 lines (+20/-3)
3 files modified
linaro-android-media-create (+8/-0)
linaro_image_tools/media_create/__init__.py (+4/-3)
linaro_image_tools/utils.py (+8/-0)
To merge this branch: bzr merge lp:~milo/linaro-image-tools/hwpack-args
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+138235@code.launchpad.net

Commit message

Added command line option for Android hwpack.

Description of the change

The proposed branch adds support for the new l-a-m-c command line option to pass and Android hwpack.
A small refactoring has been done: the debug option has been moved as a common option to all the args parser.

To post a comment you must log in.
594. By Milo Casagrande

Merged android-boards into hwpack-args.

595. By Milo Casagrande

Merged android-boards into hwpack-args.

596. By Milo Casagrande

Merged android-boards into hwpack-args.

597. By Milo Casagrande

Merged android-boards into hwpack-args.

598. By Milo Casagrande

Merged android-boards into hwpack-args.

599. By Milo Casagrande

Merged android-boards into hwpack-args.

600. By Milo Casagrande

Merged android-boards into hwpack-args.

Revision history for this message
Данило Шеган (danilo) wrote :

Revert the atexit.register change (as discussed), and good to go.

review: Approve
601. By Milo Casagrande

Reverted atexit call.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'linaro-android-media-create'
--- linaro-android-media-create 2012-12-28 16:00:31 +0000
+++ linaro-android-media-create 2012-12-28 16:00:32 +0000
@@ -41,6 +41,7 @@
41 )41 )
42from linaro_image_tools.media_create import get_android_args_parser42from linaro_image_tools.media_create import get_android_args_parser
43from linaro_image_tools.utils import (43from linaro_image_tools.utils import (
44 additional_android_option_checks,
44 ensure_command,45 ensure_command,
45 get_logger46 get_logger
46 )47 )
@@ -93,6 +94,8 @@
9394
94 logger = get_logger(debug=args.debug)95 logger = get_logger(debug=args.debug)
9596
97 additional_android_option_checks(args)
98
96 # If --help was specified this won't execute.99 # If --help was specified this won't execute.
97 # Create temp dir and initialize rest of path vars.100 # Create temp dir and initialize rest of path vars.
98 TMP_DIR = tempfile.mkdtemp()101 TMP_DIR = tempfile.mkdtemp()
@@ -107,6 +110,11 @@
107 SDCARD_DISK = os.path.join(TMP_DIR, 'sdcard-disc')110 SDCARD_DISK = os.path.join(TMP_DIR, 'sdcard-disc')
108111
109 board_config = get_board_config(args.dev)112 board_config = get_board_config(args.dev)
113 if args.hwpack:
114 board_config.from_file(args.hwpack)
115 else:
116 logger.warning("No Android hwpack provided: default board values "
117 "will be used.")
110 board_config.add_boot_args(args.extra_boot_args)118 board_config.add_boot_args(args.extra_boot_args)
111 board_config.add_boot_args_from_file(args.extra_boot_args_file)119 board_config.add_boot_args_from_file(args.extra_boot_args_file)
112120
113121
=== modified file 'linaro_image_tools/media_create/__init__.py'
--- linaro_image_tools/media_create/__init__.py 2012-10-22 06:57:20 +0000
+++ linaro_image_tools/media_create/__init__.py 2012-12-28 16:00:32 +0000
@@ -78,6 +78,7 @@
78 parser.add_argument(78 parser.add_argument(
79 '--extra-boot-args-file', dest='extra_boot_args_file',79 '--extra-boot-args-file', dest='extra_boot_args_file',
80 required=False, help=('File containing extra boot arguments.'))80 required=False, help=('File containing extra boot arguments.'))
81 parser.add_argument("--debug", action="store_true")
8182
8283
83def get_args_parser():84def get_args_parser():
@@ -173,7 +174,6 @@
173 help="Select a bootloader from a hardware pack that contains more "174 help="Select a bootloader from a hardware pack that contains more "
174 "than one. If not specified, it will default to '%s'." %175 "than one. If not specified, it will default to '%s'." %
175 DEFAULT_BOOTLOADER)176 DEFAULT_BOOTLOADER)
176 parser.add_argument("--debug", action="store_true")
177177
178 add_common_options(parser)178 add_common_options(parser)
179 return parser179 return parser
@@ -189,6 +189,9 @@
189 '--image-file', '--image_file', dest='device',189 '--image-file', '--image_file', dest='device',
190 help='File where we should write the image file.')190 help='File where we should write the image file.')
191 parser.add_argument(191 parser.add_argument(
192 '--hwpack', required=False,
193 help=('An Android hardware pack file with the board configuration.'))
194 parser.add_argument(
192 '--image-size', '--image_size', default='2G',195 '--image-size', '--image_size', default='2G',
193 help=('The image size, specified in mega/giga bytes (e.g. 3000M or '196 help=('The image size, specified in mega/giga bytes (e.g. 3000M or '
194 '3G); use with --image_file only'))197 '3G); use with --image_file only'))
@@ -202,7 +205,6 @@
202 '--console', action='append', dest='consoles', default=[],205 '--console', action='append', dest='consoles', default=[],
203 help=('Add a console to kernel boot parameter; this parameter can be '206 help=('Add a console to kernel boot parameter; this parameter can be '
204 'defined multiple times.'))207 'defined multiple times.'))
205
206 parser.add_argument(208 parser.add_argument(
207 '--system', default='system.tar.bz2', required=True,209 '--system', default='system.tar.bz2', required=True,
208 help=('The tarball containing the Android system paritition'))210 help=('The tarball containing the Android system paritition'))
@@ -212,7 +214,6 @@
212 parser.add_argument(214 parser.add_argument(
213 '--boot', default='boot.tar.bz2', required=True,215 '--boot', default='boot.tar.bz2', required=True,
214 help=('The tarball containing the Android root partition'))216 help=('The tarball containing the Android root partition'))
215
216 parser.add_argument(217 parser.add_argument(
217 '--no-part', dest='should_create_partitions', action='store_false',218 '--no-part', dest='should_create_partitions', action='store_false',
218 help='Reuse existing partitions on the given media.')219 help='Reuse existing partitions on the given media.')
219220
=== modified file 'linaro_image_tools/utils.py'
--- linaro_image_tools/utils.py 2012-10-22 06:57:20 +0000
+++ linaro_image_tools/utils.py 2012-12-28 16:00:32 +0000
@@ -346,6 +346,14 @@
346 "--hwpack argument (%s) is not a regular file" % hwpack)346 "--hwpack argument (%s) is not a regular file" % hwpack)
347347
348348
349def additional_android_option_checks(args):
350 """Checks that some of the args passed to l-a-m-c are valid."""
351 if args.hwpack:
352 if not os.path.isfile(args.hwpack):
353 raise InvalidHwpackFile(
354 "--hwpack argument (%s) is not a regular file" % args.hwpack)
355
356
349def check_required_args(args):357def check_required_args(args):
350 """Check that the required args are passed."""358 """Check that the required args are passed."""
351 if args.dev is None:359 if args.dev is None:

Subscribers

People subscribed via source and target branches