site  contact  subhomenews

Yocto Project

June 23, 2016 — BarryK
I recently wrote about OpenEmbedded:
http://bkhome.org/news/201606/playing-with-cross-compile-toolsets.html

I was impressed because it compiled without error, unlike other similar tools.

I read that OE can be configured to do a x86_64 x32 build, which is something that am very keen on exploring.

There was some promise that T2 will support x32:
http://bkhome.org/news/201601/t2-supports-x32abi.html

...however, that remains broken.

Yocto is a tool for compiling "embedded distributions", and uses OpenEmbedded:
https://www.yoctoproject.org/

As described here, Yocto supports x32:
https://lwn.net/Articles/548838/

If you want to learn more about x32, look here:
https://en.wikipedia.org/wiki/X32_ABI

I decided to download Yocto, and attempt a x86_64 x32 build. Getting started instructions are here:
https://www.yoctoproject.org/docs/current/yocto-project-qs/yocto-project-qs.html

I am running Quirky Werewolf 7.4 x86_64. Note that the 'chrpath' executable is required, and I downloaded 'chrpath-0.16.tar.gz' and compiled and installed it -- don't recall where got it from.

Here is a summary of my steps:
> git clone git://git.yoctoproject.org/poky

> cd poky
> git checkout krogoth

this initialises the build environment:
> source oe-init-build-env


I edited oe-core/build/local.conf:

edited:
MACHINE ?= "genericx86-64"
PACKAGE_CLASSES ?= "package_deb"

inserted:
DEFAULTTUNE = "x86-64-x32"

BB_NUMBER_THREADS = "1"
PARALLEL_MAKE = "-j 1"
BB_NUMBER_PARSE_THREADS = "1"

edit meta/classes/sanity.bbclass, comment-out:
if 0 == os.getuid():
raise_sanity_error("Do not use Bitbake as root.", d)

Like this (keep the indentation):
# if 0 == os.getuid():
# raise_sanity_error("Do not use Bitbake as root.", d)


bitbake -k option: continue if an error.

> bitbake core-image-sato-dev

Build Configuration:
BB_VERSION = "1.30.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Quirky-7.4"
TARGET_SYS = "x86_64-poky-linux-gnux32"
MACHINE = "genericx86-64"
DISTRO = "poky"
DISTRO_VERSION = "2.1"
TUNE_FEATURES = "mx32"
TARGET_FPU = ""
<

I set the number of parallel processes to "1", as my laptop overheats when set to use all 4 cores. Probably "2" would have been OK.

"krogoth" is the latest (development) version.

"core-image-sato-dev" is an image target, as described here:
http://www.yoctoproject.org/docs/2.1/ref-manual/ref-manual.html#ref-images

The build has been trundling along for a couple of hours, so far so good.

Comments

Compiling of 'dbus' failed. It tried to run "chown messagebus:messagebus <something>", but my host system, Quirky Werewolf, has user 'messagebus' but not group 'messagebus'.

So I just ran "addgroup -S messagebus" in the host system.

Off she went again. I went to bed. Got up this morning, Yocto is still compiling. Of course just running one CPU core, so it will be a tad slow.

Failure is due to some kind of 32-bit versus 64-bit confusion. Which is likely due to that x32.

I do not yet know how to remove a package from the build-list, so have just done this:

> bitbake -k core-image-sato-dev

The "-k" option tells it not to stop on any errors.

There is a EXT4 image, which I mounted and copied to a hard drive partition, and booted successfully.

Not much in this build, just leafpad text-editor, matchbox window-manager, gstreamer, urxvt.

Now have to get back to reading the docs, see how to compile more apps.

Tags: linux