Template:Luneos build

From WebOS-Ports
Revision as of 22:09, 28 September 2014 by Garfonso (talk | contribs)
Jump to: navigation, search

Setup the build environment

Before you can build, you will need some tools. If you try to build without them, bitbake will fail a sanity check and tell you about what's missing, but not really how to get the missing pieces.

If your distribution is Ubuntu, you need to be running the bash shell. You can be sure you are running this shell by entering the following command and selecting "No" at the prompt:

    $ sudo dpkg-reconfigure dash

The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command:

    $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \
    build-essential chrpath libsdl1.2-dev xterm

For other Linux distributions please have a look at the Yocto Project Quick Start guide.


The steps below will setup your build environment for a development build. If you want to build the latest release use ENV_NAME=stable instead but keep in mind that all new developed features need to go into testing first before they are submitted to stable.

 $ cd into-your-build-directory
 $ mkdir webos-ports-env && cd webos-ports-env
 $ export ENV_NAME=testing
 $ wget https://raw.github.com/webOS-ports/webos-ports-setup/$ENV_NAME/Makefile
 $ make setup-webos-ports

This has been tested on Gentoo (shr-chroot) and Ubuntu-12.04 amd64 and should work almost everywhere where valid toolchain is provided.

You need a lot of RAM to link qtwebkit, make sure you have at least 6GB (it's OK when some of that is swap, because it's used only for short part of build). Webkit needs so much ram to link because it's linking with debug symbols (huge files) which are stripped later in do_package after creating -dbg packages.

You can add extra 2GB of swap file like this:

 $ dd if=/dev/zero of=swap_2gb.img bs=1024k count=2048
 $ mkswap swap_2gb.img
 $ sudo swapon swap_2gb.img

If you want it permanently add it to your /etc/fstab.


Make sure you're _not_ root, as the build will fail. If you SU in the middle, don't forget to set up env afresh (. setup-env)

To configure to build (notice '.' which is actually bash 'source' command):

 $ cd into-your-build-directory/webos-ports-env/webos-ports
 $ . setup-env

To update metadata

 # go one level up to the webos-ports-env dir
 $ cd ..
 $ make update
 # or if it shows warning about different bblayers.conf or layers.txt
 $ make update-conffiles && make update
 # you can also add UPDATE_CONFFILES_ENABLED = 1 to config.mk
 # if you never want to have any uncommited changes in your checkouts RESET_ENABLED = 1 in config.mk
 # go back to the webos-ports dir to continue with the build process
 $ cd webos-ports

To build the webos-ports-dev-image for a device ({{#lowercase:{{{device_codename}}}}}):

 $ MACHINE={{#lowercase:{{{device_codename}}}}} bb webos-ports-dev-package

After the build completes, you will find your image in <build env>/tmp-eglibc/deploy/images/{{#lowercase:{{{device_codename}}}}}/

Speeding up the build

You can tune bitbake to use more of your processor. Edit webos-ports/conf/local.conf and uncomment the PARALLEL_MAKE and BB_NUMBER_THREADS lines. PARALLEL_MAKE should be set to the number of processor cores you have (or the number you have made available to the VM in the case of a VM) and BB_NUMBER_THREADS can be set from one to two times that, depending upon RAM, processor speed, other tasks running and Hyper-threading support. Example values: