New Feature for Linaro Image Tools: Android Hwpack

29 Jan
2013/01/29

Finally, after some delays, Linaro Image Tools now has support for Android hardware pack (or Android hwpack).

What is an Android hwpack

Let’s start with with clearing out the confusion the term “hwpack” has in this context.

Generally speaking, for Linaro Image Tools an hwpack is a tar-ball that contains Debian packages, some configuration and metadata files, and some directory structures, needed to create and install bootable operating system images.

Linaro Image Tools has had support for this kind hwpack since the beginning of time, but they are not necessary to create Android bootable images. The process to create an Android image is slightly different.

This new hwpack, the Android hwpack, is just a configuration file, based on the same syntax of previous Linaro Image Tools hwpack, that stores information necessary to correctly create Android images. An Android hwpack does not contain any Debian packages nor binary blob or anything else, it is just a text file (a YAML file for instance).

It’s probably better to call is “Android configuration file“.

Why an Android hwpack

The necessity for this came out during last Linaro Connect Europe, from the Android team. The needs were an easy way to add support for new boards (without having to hack into Linaro Image Tools code), the possibility to change board parameters (almost) “on-the-fly” for testing (without having to touch code), and the possibility to maintain backward compatibility by providing some kind of “versioned” hwpack, guaranteed to work for specific Linaro releases.

How to use it

In order to use it, you need to have at least Linaro Image Tools version 2013.01. At the time of this writing, Android hwpack support is also being built into the Android boot tarball, so it should be totally transparent for the user: no need to add command line arguments and to pass file paths.

Still, it is possible to pass an Android hwpack to Linaro Android Media Create, the command line tools that creates Android bootable images. The command line argument is the same as Linaro Media Create one: –hwpack

So, if you want to use the new feature, arm yourself with an Android hwpack file (examples can be found on GitHub), and run:

linaro-android-media-create --mmc /dev/sdc --dev panda --boot boot.tar.bz2 --system system.tar.bz2 --userdata userdata.tar.bz2 --hwpack panda-hwpack

Backward compatibility has been maintained: the old hard-coded values have been kept, so it is still possible to use everything in the old way.

If you find bugs, of other possible improvements, feel free to leave them in the comments below, or better on Launchpad.

Tags: , , ,