Merge lp://qastaging/~milo/linaro-image-tools/multiple-boards-support into lp://qastaging/linaro-image-tools/11.11
Status: | Merged |
---|---|
Merged at revision: | 537 |
Proposed branch: | lp://qastaging/~milo/linaro-image-tools/multiple-boards-support |
Merge into: | lp://qastaging/linaro-image-tools/11.11 |
Diff against target: |
3318 lines (+1824/-388) 15 files modified
linaro-hwpack-install (+20/-5) linaro_image_tools/hwpack/builder.py (+35/-4) linaro_image_tools/hwpack/config.py (+490/-205) linaro_image_tools/hwpack/hardwarepack.py (+194/-25) linaro_image_tools/hwpack/hardwarepack_format.py (+9/-0) linaro_image_tools/hwpack/hwpack_convert.py (+15/-3) linaro_image_tools/hwpack/hwpack_fields.py (+3/-0) linaro_image_tools/hwpack/tests/__init__.py (+1/-0) linaro_image_tools/hwpack/tests/test_config.py (+10/-8) linaro_image_tools/hwpack/tests/test_config_v3.py (+738/-0) linaro_image_tools/hwpack/tests/test_hardwarepack.py (+177/-86) linaro_image_tools/hwpack/tests/test_hwpack_converter.py (+24/-0) linaro_image_tools/media_create/boards.py (+27/-27) linaro_image_tools/media_create/chroot_utils.py (+12/-2) linaro_image_tools/media_create/tests/test_media_create.py (+69/-23) |
To merge this branch: | bzr merge lp://qastaging/~milo/linaro-image-tools/multiple-boards-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Данило Шеган (community) | Needs Fixing | ||
Stevan Radaković | Pending | ||
Linaro Infrastructure | Pending | ||
Review via email: mp+115991@code.qastaging.launchpad.net |
Description of the change
Finally, after small and tricky problems, the final code.
Diff might be a little bit bigger than expected, bzr didn't like one merge and we had to remove some files, that had been renamed.
There are also small tweaks done in the converter.
What we have here is:
- Multiple bootloaders in the hwpack and in the hwpack config, all V3
- Multiple boards in the hwpack config V3
- Safe handling of both old and new syntax in the Config class, with tests for both
- New metadata format for new hwpack confing syntax (always YAML based, but slightly different from the hwpack config one, in order to be able to parse it easier inside the linaro-
- Safe use of V2 hwpack configuration file and creation of V2 hwpack archive; safe use of a converted V3 configuration file and creation of a V3 hwpack archive: images get created, and boot (at least with pandaboard)
What we are missing at the moment:
- Choosing the right bootloader: we need a real example of one, so that we can create a real hwpack archive, and test it out
- With reference to the BP: we do not have yet the hwpack probing system, the board selection is still hardcoded (but it should'nt be hard to conver it), ther bootloader selection is not there.
It might also be good to know what is supposed to happen with the install, in order to understand if something is broken or not.
Hey Milo,
Thanks for putting the extra effort to make this happen. This includes
James as well :)
Overall, the changes are great.
My main gripe is that I am seeing a huge branch like this. I still
can't see why this was not done in several branches: one to parse the
new hwpack config, another to produce the new hwpacks and the third one
to port l-m-c to use them.
Also, a BP workitems are still out of date I believe.
> === modified file 'linaro- hwpack- convert' hwpack- convert 2012-07-19 15:21:06 +0000 hwpack- convert 2012-07-20 14:12:31 +0000 Exception, validate_ args, image_tools. hwpack. builder import ConfigFileMissing image_tools. __version_ _ import __version__
> --- linaro-
> +++ linaro-
> @@ -31,6 +31,7 @@
> HwpackConverter
> check_and_
> )
> +from linaro_
> from linaro_
This change looks unnecessary (judging by the diff itself). If it's
not, something was badly broken before :)
> === modified file 'linaro- hwpack- install' {HWPACK_ DIR}/metadata' ) as configv3: readlines( ): '^(\s*) (\S.+): \s+(.+) \s*$', line) '^(\s*) (\S.+): \s*$', line) '^(\s*) -\s*(.+ )\s*$', line) value.group( 1)) match.group( 1)) item.group( 1)) indent[ new_indent] indent[ indent] = root point[' '].append( list_item. group(2) )
...
> @@ -111,6 +111,68 @@
> tar zxf "$HWPACK_TARBALL" -C "$HWPACK_DIR"
> echo "Done"
>
> +function query_v3_metadata {
> + python -c "import re
> +with open('$
> + config = {} # Will store decoded YAML in here
> + root = config # Current insert point for adding data
> + root_at_indent = {}
> + indent = 0
> + for line in configv3.
> + key_value = re.search(
> + key_match = re.search(
> + list_item = re.search(
> +
> + if key_value:
> + new_indent = len(key_
> + elif key_match:
> + new_indent = len(key_
> + elif list_item:
> + new_indent = len(list_
> +
> + if new_indent < indent: #Indent decreases: go back up config structure
> + root = root_at_
> + elif new_indent > indent: # Indent increases: reset root (insert point)
> + root_at_
> + root = root[key]
> + indent = new_indent
> +
> + if key_value: # key: value
> + key = key_value.group(2)
> + root[key] = key_value.group(3)
> + elif key_match: # key:
> + key = key_match.group(2)
> + root[key] = {}
> + elif list_item: # - value
> + # If the list has extra indentation then root == {}
> + # If the list doesn't have extra indentation, root = {key: {}}
> + # We need to create a list in that empty dictionary. Work out
> + # where it is, assign it to insert_point.
> + insert_point = None
> + if root == {}:
> + insert_point = root
> + keys = root.keys()
> + if len(keys) == 1:
> + insert_point = root[keys[0]]
> +
> + if insert_point == {}:
> + insert_point[''] = []
> +
> + insert_
> +
> + keys = '$1'.split(' ')
> + for key in keys:
> + if isinstance(config, list):
> + key = int(key)
> + config = config[key]
> + ...