Hardware packs are a way of distributing the hardware-specific packages needed to make an image (such as the nano or ALIP image) work on a particular board without including them in the image itself.
This is useful because a single image can then be used across many types of boards, just by varying the hardware packs that are used.
What is a hardware pack?
Put most simply, a hardware pack is something you can install with linaro-hwpack-install, which most often invoked when you pass the --hwpack option to linaro-media-create.
More concretely a hardware pack is a tarball that contains, at a minimum, a list of packages that should be installed the required packages, a "dependency package" and some metadata. It usually contains the binary .debs for the packages that will be installed as well.
If the .debs are excluded then the hardware pack is just a list of packages to install, and the packages themselves will be fetched from a repository.
The "dependency package" depends on the packages in the hwpack -- and so prevents apt-get autoremove from removing them -- and has a name and version matching that of the hwpack, meaning that it is possible to tell from a running image which hwpack was used to create it.
The hardware pack can also contain extra sources to add to apt, either to fetch the packages from if the .debs are missing from the hwpack, or to get updates to the packages.
Lastly there is some extra metadata about the hwpack in the "metadata" file, as well as a "FORMAT" file that contains the format of the hwpack, so that we can change the format later if desired.
Installing a hardware pack
A hardware pack can be installed using the "linaro-hwpack-install" command from the "linaro-image-tools" package.
However, usually hardware packs will be installed using the "--hwpack" option to "linaro-media-create", which calls "linaro-hwpack-install" as appropriate to install the hardware pack in to the image that it is creating.
Creating a hardware pack
Hardware packs are created using the "linaro-hwpack-create" command from the "linaro-image-tools" package.
You pass the command a configuration file for the hardware pack that you want to build, along with the version number of the hwpack that you want to create.
The tool will then create a number of hardware pack according to the configuration file, and write them to the current directory. There will be one hardware pack created for each architecture specified. The tool can build hardware packs for any architecture regardless of the host.
linaro-hwpack-create hwpacks/omap3 1
The configuration file format
You can see an example configuration (for the vexpress board) at http://bazaar.launchpad.net/~linaro-maintainers/linaro-images/hwpack.natty.linaro-vexpress/annotate/head:/hwpacks/linaro-vexpress
The configuration starts out with some general information about the hardware pack.
The key indicating that this is the general information section of the configuration.
The version of the hwpack format used in the config file. This should be 2.0 to be able to use most of the fields described below. If this line is missing, then format=1.0 is assumed.
The name of the hardware pack.
The architectures that the hardware pack should be built for, space separated.
An optional value specifying where the hardware pack should record that it came from.
maintainer=Linaro Platform <email@example.com>
An optional value specifying who should be contacted about problems with the hardware pack.
An optional value specifying whether the hardware pack is supported. Possible values are "supported" or "unsupported".
This is the list of packages to install in the hardware pack, space separated. All dependencies will be automatically included.
NOTE: Meta-packages should be used for the kernel. Otherwise, package names will change each time the ABI is bumped. Directions for creating a meta-package can be found here:
This is an optional list of packages that the tool can assume will be installed on the target system. These packages and their dependencies will then not be included in the hardware pack. There may be issues if the hardware pack is used with images that do not have these packages installed.
MMC id to use in 'fatload mmc <mmc_id>'. The second part is used to calculate mmc_part_offset.
Debian package containing the u-boot binary. The package will not be installed in the target rootfs.
The u-boot file that will be extracted from the u_boot_package. Example
Set to 'Yes' to copy the u_boot_file to the boot partition.
Set to the desired seek offset to dd the u_boot_file to the boot device at the specified offset. If this is not specified, the u-boot binary will not be dd:d.
Debian package containing the spl binary. The package will not be installed in the target rootfs. It may be the same package as u_boot_package.
The spl file that will be extracted from the spl_package.
Set to 'Yes' to copy the spl_file to the boot partition.
Set to the desired seek offset to dd the spl_file to the boot device at the specified offset. If this is not specified, the spl binary will not be dd:d.
Set to 'Yes' to dd the env to the boot device. Since this is only used for Samsung boards, the samsung_env_start/len fields are used.
Create two or three partitions. Valid options are bootfs_rootfs, bootfs16_rootfs or reserved_bootfs_rootfs.
Kernel file relative to the target rootfs. This is expected to be installed by a package listed in the packages field.
Initrd file relative to the target rootfs. This is expected to be installed by a package listed in the packages field.
DTB file relative to the target rootfs. This is expected to be installed by a package listed in the packages field.
extra_boot_options=earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0
Filename of the boot script to be created in the bootfs.
Path to the Snowball startup files configuration. The actual file is contained in startfiles.deb in the hwpacks.
Start of the loader (or "reserved") partition.
Start of Samsung BL1.
Length of Samsung BL1.
Length of Samsung ENV.
Length of Samsung BL2.
Following this section are a number of sections specifying repositories to take packages from:
[ubuntu] sources-entry=http://ports.ubuntu.com/ natty main universe [updates] sources-entry=http://ports.ubuntu.com/ natty-updates main universe [security] sources-entry=http://ports.ubuntu.com/ natty-security main universe [linaro] sources-entry=http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu natty main # If you want to use packages from a private PPA, you can specify the user/key in the URL just as you # would in your sources.lst. Although this will probably be used mostly by Landing Teams, one can use # that but needs to remember that the hwpack will include the packages from the private PPA so it # should not be made public. [private-ppa] sources-entry=https://user:firstname.lastname@example.org/... natty main (Note: Each line specifies the current release, which at this time is "natty")
There is one section per repository, with the section heading being a unique key for that source. The sources-entry for each is the "deb" line that would be put in the sources.list for that repository, minus the "deb" part itself.
Creating a hardware pack for the Linaro Stable Kernel
If you are using an LSK based kernel with any of the supported platforms you could script the operation.
Below an example on how to generate a hwpack for the vexpress-tc2 board:
Assuming you have already compiled your kernel and have a valid config (.config) you would issue the following set of commands from the top level directory of the lsk based kernel tree
$ cd /path/to/kernel/tree $ export hwpack_type=vexpress $ export board_types=vexpress-tc2 $ export kernel_flavour=vexpress $ git clone --depth 1 http://git.linaro.org/ci/job/configs.git $ git clone --depth 1 http://git.linaro.org/ci/lci-build-tools.git $ export use_config_fragment=1 $ export conf_filenames="./.config" $ bash -x lci-build-tools/jenkins_kernel_build_inst
This sequence of operations will generate the tar.gz hwpack file on top level directory of the kernel tree.
Linaro hardware packs
The hardware packs that linaro builds are built by the same service that builds the images. To request your new hardware pack be build by the service please email Fathi Boudra with details of the hardware pack, the launchpad tree where it is currently located and any special instructions.
The configurations are in branches under the linaro-images project in Launchpad
Each branch starts with "hwpack." and contains the configuration file for that hardware pack. It also contains a "project" file with configuration information for offspring.
To modify the contents of linaro hardware packs you should modify these files, and the next build will pick up the changes. If you have access you can change the branches directly, otherwise use a Launchpad merge proposal to propose the changes for merging.
HardwarePacks (last modified 2015-01-19 20:11:51)