Template:Luneos build

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 commands: $ curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \ build-essential chrpath libsdl1.2-dev xterm nodejs bzr

(Recently, building on 64-bit Ubuntu 16.04 also required apt-get install gcc-multilib g++-multilib.)

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

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

You need a lot of RAM to link QtWebEngine, 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). QtWebEngine 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.

Building
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):

To update metadata

After the build completes, you will find your image in /tmp-glibc/deploy/images//

Clean up the work directory
If you run out of disk space during a build, run the following command from the webos-ports directory, then build again: This removes all build things but OE luckily has a copy of every build result in a cache folder called sstate-cache which you should keep to let OE quickly rebuild everything from the cache instead to do it from scratch (next build will be quite faster).

If you run out of space because of a too large sstate-cache folder you can clean it up to contain only the results for the latest component versions with the following command:

Adding Swap Space
To speed up the build, you can add extra 2GB of swap file like this:

If you want it permanently add it to your /etc/fstab. If the swap file is /var/swap_2gb.img, add the following lines to /etc/fstab: /var/swap_2gb.img swap         swap    sw              0       0
 * 1) additional swap

Speeding up the build
Bitbake automatically uses all of the processors assigned to your virtual machine and gives good result on a variety of systems. You can tune bitbake for modest improvements in build speed, but the correct parameters depend on whether builds are limited by processors, disk I/O, or network I/O. Edit webos-ports/conf/local.conf and uncomment the PARALLEL_MAKE and BB_NUMBER_THREADS lines.

Example values: