Building from Source¶
This is a guide for building the base Linux microPlatform (LmP) from source for Raspberry Pi 3 (64-bit). Additional information specific to other targets is provided in Supported Machines.
This guide assumes the reader is familiar with basic concepts of OpenEmbedded. It is not meant to be an introduction to the OpenEmbedded / Yocto Project. If you’re just getting started, it’s strongly recommended to begin with the documentation provided in Install the LmP for your FoundriesFactory.
Locally built images are useful for local development, testing and for hardware enablement, but are not meant to be updated via OTA. For OTA support we recommend creating your own Factory and using our continuous integration system.
You will need a x86 computer to develop on; Linux is currently natively supported. On macOS and Windows, see Development Container for information on setting up a containerized Linux build environment.
You will also require at least 50GB of storage for a complete Linux microPlatform build.
Set Up Build Environment¶
On Debian-based Linux distributions, including Ubuntu, run:
$ sudo apt-get install coreutils gawk wget git-core diffstat unzip \ texinfo g++ gcc-multilib build-essential chrpath socat cpio \ openjdk-11-jre python2.7 python3 python3-pip python3-pexpect xz-utils \ debianutils iputils-ping libsdl1.2-dev xterm libssl-dev libelf-dev \ android-tools-fsutils ca-certificates repo whiptail
If you are running Ubuntu 18.04, make sure to enable the universe
repository by adding following line to your
deb http://archive.ubuntu.com/ubuntu/ bionic universe
On other Linux distributions, please check the Yocto Project Quick Start Guide for additional guidance.
Install the Linux microPlatform¶
Download the meta layers¶
The Linux microPlatform sources can be placed in any directory on your workstation, as long it provides enough disk space for the complete build. This uses the Google Repo tool to fetch a variety of Git repositories at known-good revisions, and keep them in sync as time goes on.
Make an installation directory for the Linux microPlatform, and change into its directory:
mkdir lmp && cd lmp
(You can also reuse an existing installation directory, or
/build/lmpif building inside the lmp-sdk container, as described at Development Container)
Install update 85 using repo:
repo init -u https://github.com/foundriesio/lmp-manifest -b refs/tags/85 repo sync
Set up Work Environment¶
Next, set up your work environment for building the source.
MACHINE target used by this guide is
raspberrypi3-64. (For information on other hardware platforms, see
The default distribution (
DISTRO) is automatically set to
which is provided by the meta-lmp-base layer (see
OpenEmbedded / Yocto Project Layers for more details).
Set up your work environment using the
MACHINE=raspberrypi3-64 source setup-environment [BUILDDIR]
MACHINE is not provided, the script will list all possible
machines found in every enabled OpenEmbedded / Yocto Project layer,
and force one to be selected.
BUILDDIR is optional; if it is not specified, the script will default to
build-lmp. Keep in mind that
BUILDDIR must be within the
directory, otherwise your build will fail.
Build the lmp-base-console Image¶
You can build the Linux microPlatform base-console image by running:
Depending on the amount of RAM and number of processors and cores in your system, the speed of your Internet connection, and other factors, the first build could take several hours. Subsequent builds run much faster since some artifacts are cached.
At the end of the build, your build artifacts will be found under
deploy/images/raspberrypi3-64. The artifact you will
use to flash your board is
Install the LmP for your FoundriesFactory¶
In case you are already working with a FoundriesFactory, you can instead download the source code for that factory with the following steps.
Make an installation directory for the LmP for that
<factory-name>, and change into its directory:
mkdir <factory-name> && cd <factory-name>
<factory-name>meta layers using repo:
repo init -u https://source.foundries.io/factories/<factory-name>/lmp-manifest.git -b devel -m <factory-name>.xml repo sync
<factory-name>.xmlrefers to all the LmP meta layers and also to the
<factory-name>specific repositories as described Factory Source Code.
- Build the image for
MACHINE=<machine-name> source setup-environment [BUILDDIR] bitbake lmp-factory-image
MACHINEshould be set to a supported machine. see the current available option in Supported Machines.)
BUILDDIRis optional; in case it is not provided, script default is
lmp-factory-imageis the suggested default image, and can be customized with the steps from Adding Packages to the Image.
It is worth remembering that the
bitbakestep can take a while.
At the end of the build, your build artifacts is found under
deploy/images/<machine-name>. The artifact you use to flash your board is
The local build of your FoundriesFactory is great for developing and debugging and the results can be used on the host machine or deployed to a hardware board.
However, the image created locally is not yet visible for the OTA system, and is only available for local use.
When you push the changes to the FoundriesFactory git repositories and trigger a new build you can flash and register your device following the instructions of Flash your Device and Register your device. This way you can take full advantage of OTA system.