|Version 21 (modified by Ben, 13 months ago) (diff)|
- Configuration (optional)
- Building all SHR packges
- Track and browse remote metadata on the web
This page describes how to set up the SHR build environment on a GNU/Linux system using the chroot method. This is the recommended route for beginners as it will minimize the influence of your host system, and as the majority of SHR users choose this method it is more thoroughly tested.
Downloading the Makefile
The first step is to download the FSO/SHR Makefile from http://build.shr-project.org/ :
$ wget http://build.shr-project.org/Makefile
The next step is to run one of the following commands depending whether you have a 32 or 64 bit operating system.
If you have a 64 bit system use this command:
$ make setup-shr-chroot
If you have a 32 bit system use this command:
$ make setup-shr-chroot-32bit
*Note that the 64 bit method is more actively maintained by SHR developers.
The above command will checkout the shr-chroot repository to a directory called shr-chroot. It will download a large number of files via git so it may take a while to complete if you have a slow connection. It will also change UID/GID of included bitbake account from default 1026 to UID/GID of user who called setup-shr-chroot.
Entering the chroot
First enter the directory:
$ cd shr-chroot
Then you need sudo in order to bind important system directories, and then change the "/" directory via the following command:
$ sudo ./shr-chroot.sh
At this stage sudo/root is no longer required, so we switch to the ready made user account "bitbake" account.
$ su - bitbake
Next we need to checkout a common directory with shared configuration files and Makefile, openembedded directory with OE and shr-core directory:
$ make setup-shr-core
You are nearly ready to build your first image. But before you can tweak some configurations files, see next section.
Open the file shr-core/conf/local.conf with a text editor.
Make use of multiple CPUs
PARALLEL_MAKE = "-j 4" BB_NUMBER_THREADS = "4"
Disable / Minimize locales generation
To avoid multiple locales generation, add:
GLIBC_GENERATE_LOCALES = "en_US.UTF-8 en_GB.UTF-8 cs_CZ.UTF-8"
and you also need to set IMAGE_LINGUAS accordingly
IMAGE_LINGUAS = "en-us en-gb cs-cz"
or to disable locale generation at all (You can't build an shr image without the en_US.UTF-8 locale, so this is only for building single packages):
ENABLE_BINARY_LOCALE_GENERATION = "0"
this will also speed up the whole build.
Chosing a target machine
SHR Makefile sets the environment up to build for the OM-GTA02 device. To compile for other devices you can prefix MACHINE before bitbake command:
MACHINE=om-gta01 bitbake shr-image # for n900 use MACHINE=nokia900, a full list of supported devices can be found at ...
Or you can change it in setup-local (and run ". ./setup-env" again).
General build process
For each build terminal session this must be ran:
sudo shr-chroot.sh #---> enter the chroot su - bitbake #---> change to bitbake user cd shr-unstable #---> to build unstable packages . ./setup-env #---> Set build env bitbake -k <packaganame> # example package names: shr-image shr-lite-image etc. # the -k parameter causes bitbake to continue on failed dependencies. recommended for packages with large dependency trees like images.
Completed images are saved in shr-unstable/tmp/deploy/images, individual packages in shr-unstable/tmp/deploy/ipk/.
Check out the Troubleshooting section if you run into trouble.
For people coming from the old building process (i.e before the existence of shr-chroot) don't forget to take a look at the migration of old data section below in this page.
Building all SHR packges
If you want to build everything that is available in the shr feeds run the following:
bitbake -k task-shr-feed
Updating the local metadata
It is important to leave shr-chroot before updating it, so quit the shell and make sure that every binded directory is umounted:
For the 64-bit environment:
$ cd shr-chroot/OE $ make update-shr-chroot
For the 32-bit environment:
$ cd shr-chroot-32bit/OE $ make update-shr-chroot-32bit
Be aware that "make update-shr-chroot" will always revert your local changes. After updating to clean chroot it will reset UID/GID for bitbake user again.
Track and browse remote metadata on the web
- http://cgit.openembedded.org/openembedded/log/ to see what changes in OpenEmbedded;
- http://git.shr-project.org/git/ to follow SHR applications improvements.
If you are interested in developing SHR application, you should now switch over to Getting started developing SHR