Multi-target development for maemo

October 22, 2007 on 1:19 pm | In maemo | 12 Comments

Despite the fact that the maemo sdk "installer script" is the "preferred" way of installing scratchbox and the roostraps, I have never used it. I prefer to have my dpkg aware of the scratchbox. What I do instead, is grab the scratchbox packages with apt and download the rootstraps manually. These instructions are for debian/ubuntu -- on other distros/platforms you're on your own, sorry.

Here's approximately what I do:

> sudo sh -c 'echo "deb apophis main" >> /etc/apt/sources.list' # Use this on i386 systems
> sudo sh -c 'echo "deb /" >> /etc/apt/sources.list' # Use this on amd64 systems
> sudo apt-get update
> sudo apt-get install scratchbox-core scratchbox-devkit-cputransp \
scratchbox-devkit-debian scratchbox-devkit-doctools scratchbox-devkit-maemo3 \
scratchbox-libs scratchbox-toolchain-cs2005q3.2-glibc-arm \
scratchbox-toolchain-cs2005q3.2-glibc2.5-arm \
> sudo apt-get install scratchbox-toolchain-cs2007q3-glibc2.5-arm7 \
scratchbox-devkit-svn scratchbox-devkit-git

This takes a while to download and install, when it asks for users to add to scratchbox, just choose your user (and whomever might want to do scratchbox development on the box). Onwards:

> sudo wget -O /scratchbox/packages/mistral-armel-rootstrap.tgz \

> sudo wget -O /scratchbox/packages/bora-armel-rootstrap.tgz \

> sudo wget -O /scratchbox/packages/chinook-armel-rootstrap.tgz \

> sudo wget -O /scratchbox/packages/fremantle-armel-rootstrap.tgz \


These take a while too, depending obviously on the thickness of your webtubes. Now all left to do is to create scratchbox targets. Bear in mind, that you might need to re-logon to gain the sbox group, or you may also do:

> su - `whoami`

Now onto the rootstrap creation... The mistral and bora use the "glibc" -toolchain and chinook uses the "glibc2.5" -toolchain. First mistral:

> sb-conf st mistral-armel -c cs2005q3.2-glibc-arm \
-d debian-sarge:maemo3-tools:cputransp:doctools:perl:maemo3-debian \
-t qemu-arm-0.8.2-sb2
> sb-conf rs mistral-armel /scratchbox/packages/mistral-armel-rootstrap.tgz
> sb-conf in mistral-armel -c -e -d -F

Bora goes pretty much the same, just replace "mistral" with "bora":

> sb-conf st bora-armel -c cs2005q3.2-glibc-arm \
-d debian-sarge:maemo3-tools:cputransp:doctools:perl:maemo3-debian \
-t qemu-arm-0.8.2-sb2
> sb-conf rs bora-armel /scratchbox/packages/bora-armel-rootstrap.tgz
> sb-conf in bora-armel -c -e -d -F

Okie, now we have two rootstraps, missing only chinook, it goes like this:

> sb-conf st chinook-armel -c cs2005q3.2-glibc2.5-arm \
-d debian-sarge:maemo3-tools:cputransp:doctools:perl:maemo3-debian \
-t qemu-arm-0.8.2-sb2
> sb-conf rs chinook-armel /scratchbox/packages/chinook-armel-rootstrap.tgz
> sb-conf in chinook-armel -c -e -d -F

Now trying also fremantle =)

> sb-conf st fremantle-armel -c cs2007q3-glibc2.5-arm7 \
-d debian-etch:qemu:doctools:svn:git \
-t qemu-arm-sb
> sb-conf rs fremantle-armel /scratchbox/packages/fremantle-armel-rootstrap.tgz
> sb-conf in fremantle-armel -c -e -d -F

Now you should have scratchbox with 3 targets: one for IT2006, one for IT2007 and one for upcoming IT2008.

Additional notes: the "bora" rootstrap is broken, it requires you to either install the "virtual packages" or install the real packages. I prefer the latter and add "deb gregale free non-free" to /etc/apt/sources.list momentarily and do "apt-get update; fakeroot apt-get -f install".

Now that you have three separate targets for different versions, you can jump from one target to another by doing sb-conf se <version>-armel. These instructions can easily be applied for i386 too, if you need to test your applications: just replace every occurrence of arm or armel with i386, drop the "cputransp" from devkits and omit the "-t qemu-arm-0.8.2-sb2" option.

Update: updated the chinook download url to the 4.0 final instead of the beta. Another: Thanks to Marius for pointing out that the perl devkit needs to be installed before it can be used.


RSS feed for comments on this post. TrackBack URI

  1. [...] Check it out! While looking through the blogosphere we stumbled on an interesting post today.Here’s a quick excerptNow that you have three separate targets for different versions, you can jump from one target to another by doing sb-conf se -armel. These instructions can easily be applied for i386 too, if you need to test your applications: … [...]

  2. VRe says:

    Nice to know that there is somebody else doing it the hard way :)

  3. inz says:

    Well, I think it's the easy way, but whatever. ;)

  4. Tom Swindell says:

    Should not chinook use debian-etch and no maemo3-debian instead of debian-sarge and maemo3-debian? Also isn't -c (C library) wrong for all targets? Might also be a good idea to add 3.1 to 3.2 upgrading 'fakeroot apt-get -f dist-upgrade'. Nice post though, was a great help :)

  5. inz says:

    I'm not sure of what debian-devkit chinook should use, but it's not that big of a deal anyway. Debian-etch would provide a bit newer debian utils, but as the point of this post was to allow development on all versions of maemo, there's no need for newer ones.

    I'm not sure of the C library either. I've experienced it to both cause and solve problems, but both cases are rare.

    And about upgrading to 3.2 (or to 3.1), at least I like to support all 3.x with single binary. 3.1 and 3.2 might be able to build binaries that work on 3.0, but then again, they might not, so I'm playing it safe.

  6. Neil Jerram says:

    For me the "fakeroot apt-get -f install" step (for bora-armel) does not succeed. Here is the output that I get when running "fakeroot apt-get -f install" again (so as to omit all the installs and upgrades that _do_ succeed):

    [sbox-bora-armel: ~] &gt; fakeroot apt-get -f install
    Reading Package Lists... Done
    Building Dependency Tree... Done
    0 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
    4 not fully installed or removed.
    Need to get 0B of archives.
    After unpacking 0B of additional disk space will be used.
    Setting up libpango1.0-common (1.8.1-1osso20) ...
    You don't have modules directory for version 1.4.0.
    Use default version instead.
    Updating the modules list for Pango-1.4.0...find: /usr/lib/pango/1.4.0/modules: No such file or directory
    /usr/sbin/update-pango-modules: line 20: /usr/bin/pango-querymodules: cannot execute binary file
    dpkg: error processing libpango1.0-common (--configure):
     subprocess post-installation script returned error exit status 126
    Setting up libgtk2.0-bin (2.6.10-2.osso30) ...
    Updating the IM modules list for GTK+-2.4.0.../usr/sbin/update-gtk-immodules: line 22: /usr/bin/gtk-query-immodules-2.0: cannot execute binary file
    dpkg: error processing libgtk2.0-bin (--configure):
     subprocess post-installation script returned error exit status 126
    dpkg: dependency problems prevent configuration of libgtk2.0-0:
     libgtk2.0-0 depends on libgtk2.0-bin (&gt;= 2:2.6.10-2.osso30); however:
      Package libgtk2.0-bin is not configured yet.
    dpkg: error processing libgtk2.0-0 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of libgtk2.0-dev:
     libgtk2.0-dev depends on libgtk2.0-0 (= 2:2.6.10-2.osso30); however:
      Package libgtk2.0-0 is not configured yet.
    dpkg: error processing libgtk2.0-dev (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
    E: Sub-process /scratchbox/devkits/debian-sarge/bin/dpkg returned an error code (1)

    The root problem seems to be /usr/bin/gtk-query-immodules not being executable. Any idea why that is?

    - Neil

  7. Graham Cobb says:

    I found that in order to create a working Bora target (in which I could install tools like intl and autoconf) I had to:

    1) Leave off the "-c" from the "sb-conf in bora-armel" command, and

    2) Edit /etc/apt/sources.list to change the references to "bora" to be to "maemo3.0". It seems that "bora" is now 3.2 and mixing that up with the 3.0 rootstrap breaks things. In any case, like Inz, I want to build packages that work on 3.* so I want to build against 3.0.

  8. FWIW your instructions don't work as written; you also need to apt-get install scratchbox-devkit-perl if you want to mention it among the other devkits.

  9. Hendrik Boom says:

    Well, I got as far as starting the rootstrap creation. The first command seemed to run; the second complained I wasn't a scratchbox user. This is presumably related to the fact that it didn't ask me for users to add to scratchbox.

    How do I go about adding myself to scratchbox at this point? Or is something else likely to be wrong?

    I did get a lot further with this set of instructions than any of the "easy" or "preferred" instructions, by the way.

    -- hendrik

  10. XTL says:

    I prefer to use tee when having to write to files with root perms from sudo:

    echo "..." | sudo tee -a /appendee/file

    no rootshell, no redirection and you happen to also see what went into the file. And you can generate the text as non-root.

  11. Any plans for updating this with a Maemo 5 target? Pretty please?

  12. Many thanks for the fremantle instructions!

    One nit: sb-conf in fremantle-armel -c -e -d -F barfs "sb-conf: Failed to install C-library to target: FREMANTLE_ARMEL"

    The official fremantle SDK installer does

    $scratchbox/tools/bin/sb-conf install $target -L --etc --devkits --fakeroot

    which translates to 'sb-conf in fremantle-armel -L -e -d -F'. I used this and got a fremantle target. (I haven't used it to build anything yet.)

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress.
Entries and comments feeds. Valid XHTML and CSS. ^Top^