aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Tunnicliffe <james.tunnicliffe@linaro.org>2012-07-25 12:06:29 +0100
committerJames Tunnicliffe <james.tunnicliffe@linaro.org>2012-07-25 12:06:29 +0100
commit3076b48fa055a31974fd08f1f7d2a24ba05a5f9f (patch)
treee465b7728d7b5a0739b0cca98d49d66b0f875733
parent69012f93cce99ecb11d0a7b7e6d0be7259786572 (diff)
Wired up command line parameters that should allow board and bootloader selection.
-rwxr-xr-xlinaro-media-create4
-rw-r--r--linaro_image_tools/media_create/__init__.py4
-rw-r--r--linaro_image_tools/media_create/boards.py15
3 files changed, 15 insertions, 8 deletions
diff --git a/linaro-media-create b/linaro-media-create
index 1f60305..87d9c6f 100755
--- a/linaro-media-create
+++ b/linaro-media-create
@@ -108,7 +108,7 @@ if __name__ == '__main__':
sys.exit(1)
board_config = board_configs[args.board]
- board_config.set_metadata(args.hwpacks)
+ board_config.set_metadata(args.hwpacks, args.bootloader, args.board)
board_config.set_board(args.board)
board_config.add_boot_args(args.extra_boot_args)
board_config.add_boot_args_from_file(args.extra_boot_args_file)
@@ -187,7 +187,7 @@ if __name__ == '__main__':
if args.should_format_bootfs:
board_config.populate_boot(
ROOTFS_DIR, rootfs_uuid, boot_partition, BOOT_DISK, media.path,
- args.is_live, args.is_lowmem, args.consoles, args.bootloader)
+ args.is_live, args.is_lowmem, args.consoles)
if args.should_format_rootfs:
create_swap = False
diff --git a/linaro_image_tools/media_create/__init__.py b/linaro_image_tools/media_create/__init__.py
index aecfbbd..11ca7c4 100644
--- a/linaro_image_tools/media_create/__init__.py
+++ b/linaro_image_tools/media_create/__init__.py
@@ -165,6 +165,10 @@ def get_args_parser():
'--bootloader',
help="Select a bootloader from a hardware pack that contains more than"
"one.")
+ parser.add_argument(
+ '--board',
+ help="Select a board from a hardware pack that supports more than one."
+ )
add_common_options(parser)
return parser
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py
index d04fe8d..5220e4b 100644
--- a/linaro_image_tools/media_create/boards.py
+++ b/linaro_image_tools/media_create/boards.py
@@ -123,9 +123,11 @@ class HardwarepackHandler(object):
hwpack_tarfiles = []
tempdir = None
- def __init__(self, hwpacks):
+ def __init__(self, hwpacks, bootloader=None, board=None):
self.hwpacks = hwpacks
self.hwpack_tarfiles = []
+ self.bootloader = bootloader
+ self.board = board
class FakeSecHead(object):
""" Add a fake section header to the metadata file.
@@ -169,7 +171,8 @@ class HardwarepackHandler(object):
if re.search("=", lines[0]) and not re.search(":", lines[0]):
# Probably V2 hardware pack without [hwpack] on the first line
lines = ["[hwpack]\n"] + lines
- parser = Config(StringIO("".join(lines)))
+ parser = Config(StringIO("".join(lines)), self.bootloader,
+ self.board)
try:
new_data = parser.get_option(field)
if new_data is not None:
@@ -299,8 +302,9 @@ class BoardConfig(object):
cls.board = board
@classmethod
- def set_metadata(cls, hwpacks):
- cls.hardwarepack_handler = HardwarepackHandler(hwpacks)
+ def set_metadata(cls, hwpacks, bootloader=None, board=None):
+ cls.hardwarepack_handler = HardwarepackHandler(hwpacks, bootloader,
+ board)
with cls.hardwarepack_handler:
cls.hwpack_format = cls.hardwarepack_handler.get_format()
if (cls.hwpack_format == cls.hardwarepack_handler.FORMAT_1):
@@ -761,8 +765,7 @@ class BoardConfig(object):
@classmethod
def populate_boot(cls, chroot_dir, rootfs_uuid, boot_partition, boot_disk,
- boot_device_or_file, is_live, is_lowmem, consoles,
- bootloader=None):
+ boot_device_or_file, is_live, is_lowmem, consoles):
parts_dir = 'boot'
if is_live:
parts_dir = 'casper'