Generating a U-boot PPA for the STE Landing Team

Current Status

Generating the STE Landing Team U-boot PPA using the git packaging method is no longer recommended. Another version of this page is also available.

U-boot packaging is now hosted here (bzr branch lp:u-boot-linaro) but a modified version for Snowball isrequired. This is because at time of writing, when attempting to build an eMMC image linaro-media-create (l-m-c) assumes that all the files listed in startfiles.cfg (located in the Snowball hwapck - startupfiles-vW_XYZ_armel.deb) are expected to be placed in /boot. Whereas the generic packaging files (in bzr) install u-boot.bin in usr/lib/u-boot/u8500_snowball/.

startupfiles.cfg currently looks like this:

# section     relative file name        align    address    load address
# The address is the exact offset into the image.
# Partition 2 (VFAT) starts at 0x400000
ISSW          boot_image_issw.bin       -1       0          -1
X-LOADER      boot_image_x-loader.bin   -1       0          -1
MEM_INIT      mem_init.bin               0       0x080000    0
PWR_MGT       power_management.bin       0       0x090000    0
UBOOT_ENV     u-boot-env.bin             0       0x0F8000    0
NORMAL        u-boot.bin                 0       0x100000    0

As stated above, all these files are assumed to be placed /boot, which is not the expected location for u-boot.bin. For the following releases, it would be more desirable to allign the snowball U-boot PPA with the other Linaro supported boards by allowing the l-m-c to fetch files from specified directories other than /boot. This will require 'startupfiles.cfg' to be modified to read:

# section     relative file name        align    address    load address
# The address is the exact offset into the image.
# Partition 2 (VFAT) starts at 0x400000
ISSW          boot_image_issw.bin       -1       0          -1
X-LOADER      boot_image_x-loader.bin   -1       0          -1
MEM_INIT      mem_init.bin               0       0x080000    0
PWR_MGT       power_management.bin       0       0x090000    0
UBOOT_ENV     u-boot-env.bin             0       0x0F8000    0
NORMAL        usr/lib/u-boot/u8500_snowball/u-boot.bin                 0       0x100000    0

Generating the U-boot PPA for Snowball

Tag the code

First you are required to tag the top commit of the tree that will end up in the PPA.

$ git remote add ste-landing-team <username>@git.linaro.org:/srv/git.linaro.org/git/bsp/st-ericsson/u-boot-lt-ux500.git
$ git fetch ste-landing-team 
$ git checkout -b ste-landing-team ste-landing-team/igloo
$ git tag <tag_name>
$ git push --tags

Fetch the packaging data and modify the release files

The Snowball U-boot packaging is hosted on launchpad.

$ bzr branch lp:~linaro-landing-team-ste/linaro-images/u-boot-ux500-packaging
Branched 23 revision(s).
$ cd u-boot-ux500-packaging
$ ls
debian

debian/platform-and-targets and debian/control files have already been tailored for Snowball and should not need to be modified. debian/rules is more interesting and specifies Which Git tree to clone under get-orig-source:

# run from a local checkout
get-orig-source:
        rm -rf $(deb_source)-$(upstream_version)
        rm -f $(deb_source)-$(upstream_version).orig.tar.gz
        git clone --depth 1 git://git.linaro.org/bsp/st-ericsson/u-boot-lt-ux500.git $(deb_source)-$(upstream_version)
        cd $(deb_source)-$(upstream_version) && git archive \
                --format=tar \
                --prefix=$(deb_source)-$(upstream_version)/ \
                $(upstream_version) \
                | gzip >../$(deb_source)_$(upstream_version).orig.tar.gz
        rm -rf $(deb_source)-$(upstream_version)

%:
        dh --with quilt $@

At this time, only the changelog needs to be modified in order to build the PAA. To do so the "dch -i" can be used:

$ dch -i

dhc -i brings you the changelog and pre-formats the new entry with what it thinks is appropriate. The first thing to do is change the current "2011.08.23-0ubuntu2". The first part (2011.08.23) needs to reflect the new tag. We also need to reset the upload number from "0ubuntu2" to "0ubuntu1". Add a comment, save and quit.

u-boot-snowball (2011.08.23-0ubuntu2) natty; urgency=low

  * 

 -- Mathieu Poirier <mpoirier@linaro.org>  Thu, 25 Aug 2011 13:11:53 -0600

u-boot-snowball (2011.08.23-0ubuntu1) natty; urgency=low

  * Updating tag.

 -- Mathieu Poirier <mathieu.poirier@linaro.org>  Tue, 23 Aug 2011 17:36:23 -0600

The above should now look like this after modifications:

u-boot-snowball (2011.08.25-0ubuntu1) natty; urgency=low

  * Adding a lot of cool features.

 -- Mathieu Poirier <mathieu.poirier@linaro.org>  Thu, 25 Aug 2011 13:11:53 -0600

u-boot-snowball (2011.08.23-0ubuntu1) natty; urgency=low

  * Updating tag.

 -- Mathieu Poirier <mathieu.poirier@linaro.org>  Tue, 23 Aug 2011 17:36:23 -0600

Build the source ppa

At this point all the hard work has been done. The PPA source files can be built with builddeb.

$ bzr builddeb -- -i -I -S

Type in your RSA key password to sign the package and the work is done. The resulting files are located in the parent directory.

$ ls .. -1
build-area   
u-boot-snowball_2011.08.25-0ubuntu1.dsc             
u-boot-snowball_2011.08.25.orig.tar.gz
u-boot-snowball_2011.08.25-0ubuntu1.debian.tar.gz  
u-boot-snowball_2011.08.25-0ubuntu1_source.changes 
 u-boot-ux500-packaging

Building the ppa locally

Before uploading the package source to the project page, one might find it useful to build the PPA locally to make sure everything is in the right place. To do so create a temporary directory and copy all the files produced above.

$ ls temp -1
u-boot-snowball_2011.08.25-0ubuntu1.debian.tar.gz  
u-boot-snowball_2011.08.25-0ubuntu1_source.changes
u-boot-snowball_2011.08.25-0ubuntu1.dsc            
u-boot-snowball_2011.08.25.orig.tar.gz

$ cd temp

Extract the source package, move to the newly created directory and launch the build command:

$ dpkg-source -x *.dsc
gpgv: Signature made Thu 25 Aug 2011 01:36:06 PM MDT using RSA key ID A88B1392
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./u-boot-snowball_2011.08.25-0the codeubuntu1.dsc
dpkg-source: info: extracting u-boot-snowball in u-boot-snowball-2011.08.25
dpkg-source: info: unpacking u-boot-snowball_2011.08.25.orig.tar.gz
dpkg-source: info: unpacking u-boot-snowball_2011.08.25-0ubuntu1.debian.tar.gz

$ cd u-boot-snowball-2011.08.25/

$ sudo debuild -eCROSS_COMPILE=arm-linux-gnueabi- -b -aarmel -k<your_ken_name>

Once again the .deb will be located in the parent directory.

Upload the ppa to the project page

The package source files are now ready for upload to the project page:

$ dput ppa:linaro-landing-team-ste/st-ericsson-u8500-public u-boot-snowball_<version>-0ubuntu1_source.changes

Hack in the ''debian/rules'' file

For the 2011.08 release the debian/rules file had to be modified in order to avoid confusing l-m-c. As stated above l-m-c expects all the files required to build the emmc image to be in /boot. To meet this requirement the following changes were made and should be reverted for latter releases:

=== modified file 'debian/rules'
--- debian/rules        2011-08-23 19:02:58 +0000
+++ debian/rules        2011-08-23 23:22:13 +0000
@@ -56,6 +56,6 @@

 override_dh_auto_install:
        while read plat target deb; do \
-           install -D -m644 debian/build/$$plat/$$target debian/u-boot-linaro-$$deb/usr/lib/u-boot/$$plat/$$target; \
+           install -D -m644 debian/build/$$plat/$$target debian/u-boot-linaro-$$deb/boot/$$target; \
        done <debian/platform-and-targets

Boards/ST-Ericsson/Snowball/building_uboot (last modified 2011-09-12 19:38:00)