[Success] Building Yocto with a Debian 9 host system


#1

Update 2018-12-30: A perfect build system setup and build. Skip to this post below.


2018-12-22 - Build log

Here, we start with a fresh Debian Stretch 9.6.0 (stable). It is the most basic installation with no extra packages. The hardware has 20 cpu cores at 2.67GHz and 10GB of ram.

Using the docs here: https://docs.neutis.io/yocto/tutorial/

+50GB free space? :ballot_box_with_check:
df -h

appropriate packages installed on the build host? :ballot_box_with_check:
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev xterm

openssl dev package installed? :ballot_box_with_check:
sudo apt-get install libssl-dev

clone the repository? :ballot_box_with_check:
git clone https://github.com/Neutis/neutis-image.git

initialize the environment? :ballot_box_with_check:
cd neutis-image
bash init.sh

ERROR: Your system needs to support the en_US.UTF-8 locale.

Reconfigure locales and select ‘en_US.UTF-8’:
sudo dpkg-reconfigure locales

There is a lot of error messages, so capture the screen output to a file this time:
bash init.sh | tee command_output.txt
more command_output.txt

It didn’t like poky-neutis as the distro name, so change it:
nano conf/local.conf
Find DISTRO ?= “poky-neutiis” and change to DISTRO ?= “poky”

This error was repeated several times:

ERROR: Could not include required file conf/machine/include/sun50i.inc

Find the file:
find . -name sun50i.inc

./meta-layers/meta-sunxi/conf/machine/include/sun50i.inc

Create a symbolic link to let bitbake find the missing include file(s).
ln -s …/…/…/…/meta-sunxi/conf/machine/include meta-layers/meta-emlid-neutis/meta-neutis-bsp/conf/machine/

Try to initialize the environment again:
bash init.sh | tee command_output.txt
more command_output.txt

ERROR: Layer ‘meta-python’ depends on layer ‘openembedded-layer’, but this layer
is not enabled in your configuration
ERROR: Layer ‘networking-layer’ depends on layer ‘meta-python’, but this layer i
s not enabled in your configuration
ERROR: Layer ‘networking-layer’ depends on layer ‘openembedded-layer’, but this
layer is not enabled in your configuration
ERROR: Layer ‘webserver’ depends on layer ‘openembedded-layer’, but this layer i
s not enabled in your configuration

add the missing layers to the bitbake configuration:
nano build/conf/bblayers.conf
Insert 2 more lines like the last into the variable BBLAYERS:

/??/??/neutis-image/meta-layers/meta-openembedded/meta-oe
/??/??/neutis-image/meta-layers/meta-openembedded/meta-python

Try to initialize the environment again:
bash init.sh | tee command_output.txt
more command_output.txt

Now the errors from init.sh are dealt with, move to the next step:
source poky/oe-init-build-env build

Build the image:
bitbake neutis-image

a few minutes elapsed…

ERROR: Nothing RPROVIDES ‘systemd’

Go to the OpenEmbedded Layer Index and search for recipes with keyword ‘systemd’:
http://layers.openembedded.org/layerindex/branch/master/recipes/?q=systemd
Since the ‘systemd’ recipe is contained within the ‘openembedded-core’ layer we must add it as a git submodule and also add it to the list of BitBake layers, and add it to the bitbake configuration:
cd …
git submodule add -b sumo git://git.openembedded.org/openembedded-core
nano init.sh

Find the comment, “# Add all required layers:” and add the required layer:
‘…/openembedded-core/meta’
Add ‘systemd’ to the bitbake configuration file:
nano poky/meta/conf/bitbake.conf
Find ‘DISTRO_FEATURES’ and add ‘systemd’:
DISTRO_FEATURES ?= “systemd”

Restart by reinitializing the environment:
bash init.sh
source poky/oe-init-build-env build

Restart building the image:
bitbake neutis-image

about 30 minutes elapsed…

ERROR: glibc-locale-2.27-r0 do_package: Fatal QA errors found, failing task.
ERROR: glibc-locale-2.27-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /??/??/neutis-image/build/tmp/work/aarch64-poky-linux/glibc-locale/2.27-r0/temp/log.do_package.26897

Reference the yocto mailing list:
https://www.mail-archive.com/yocto@yoctoproject.org/msg33501.html

nano conf/local.conf
Add ‘${DISTRO_FEATURES_LIBC}’ to the DISTRO_FEATURES variable:
DISTRO_FEATURES = “systemd ${DISTRO_FEATURES_LIBC}”

Restart building the image:
bitbake neutis-image

Success!

52 minutes elapsed for 3737 tasks, of which 2041 were previously completed.

The resulting image file is 544MB:
ls -ltrh tmp/deploy/images/neutis-n5/
The name of the image file is ‘neutis-image-neutis-n5-20181223203900.rootfs.sunxi-sdimg’. Yours will have a different number (timestamp).


Neutis N5 as a web server
[Fail] Using a Debian 10 (buster) host to flash a Yocto image onto a Neutis N5
[Fail] Using a Neutis N5 to flash a Yocto image onto another N5
#2

To rebuild the image to include a webserver:

Add this line to local.conf
nano conf/local.conf

IMAGE_INSTALL_append = " nginx"

Add this layer to the bitbake configuration:
nano build/conf/bblayers.conf

/??/??/neutis-image/meta-layers/meta-openembedded/meta-webserver \

Then rebuild:
bash init.sh
source poky/oe-init-build-env build
bitbake neutis-image

The resulting image is only 2MB larger than stock (546MB).


#3

Update 2018-12-30

A perfect build experience today off of a clean host system:

The end result is that five commands were all that was needed:

git clone git@github.com:Neutis/neutis-image.git
cd neutis-image
bash init.sh
source poky/oe-init-build-env build
bitbake neutis-image

:white_check_mark: There were no errors during the process.
:clock130: Total time: 1.5 hours start to finish.
:floppy_disk: Disk space: 44GB used by the build directory


Here are some details about the creation of the host build system:

Virtual Machine setup:
Intel cpu, 22 cores, 11G ram, 1Gb network, 60GB disk.

OS installation ISO: debian-9.6.0-amd64-DVD-1.iso

OS installation options:

These options were picked for a repeatable absolute minimum install.

  • Expert Install
  • Language - English - USA
  • Locale - en_US.UTF-8
  • Keyboard - Keymap - American English
  • one disk partition
  • no swap space
  • targeted drivers
  • no network mirror
  • no apt security updates
  • no apt release updates
  • software selection - choose none

Software setup:

Again, for a repeatable result, ISO DVDs were used as package repositories instead of network mirrors. DVDs number 1, 2, and 3 were needed to satisfy the package requirements.

First, log in as normal user.

Set up sudo priveledges:
su -l
apt-get update && apt-get install sudo
adduser “your_username” sudo
exit
logout

Log back in as normal user.

sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib bui$
sudo apt-get install libssl-dev

That’s it. The build system is ready.