This document explains how to clone and set up your Yocto environment with repo
, then build an image for Raspberry Pi 5.
- Operating System: Linux (Ubuntu/Debian recommended).
- Required Packages:
sudo apt update && sudo apt install -y git repo python3 python3-pip gawk wget diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm
- Disk Space: At least 50 GB free.
- Internet Connection: Required to clone layers and download sources.
-
Initialize
repo
:repo init -u <repository-git-url> -b <branch> --no-clone-bundle
Example:
repo init -u https://github.com/iromzy/microhil-yocto.git -b main --no-clone-bundle
-
Sync Submodules:
repo sync
-
Layer Structure: After syncing, you will have a directory structure with the required layers, for example:
microhil-yocto/ ├── default.xml ├── build/ ├── poky/ ├── meta-raspberrypi/ ├── meta-openembedded/ ├── meta-microhil/ └── ...
-
Set up the environment with
oe-init-build-env
:source poky/oe-init-build-env build
This command places you in the
build/
directory. -
Edit
bblayers.conf
: Ensure all required layers are included inconf/bblayers.conf
, for example:BBLAYERS ?= " \ ${TOPDIR}/../poky/meta \ ${TOPDIR}/../poky/meta-poky \ ${TOPDIR}/../meta-raspberrypi \ ${TOPDIR}/../meta-openembedded/meta-networking \ ${TOPDIR}/../meta-openembedded/meta-python \ ${TOPDIR}/../meta-microhil \ "
-
Edit
local.conf
: Update the build configuration inconf/local.conf
:- Target Machine:
MACHINE = "raspberrypi5"
- Build Parallelization:
BB_NUMBER_THREADS = "$(nproc)" PARALLEL_MAKE = "-j$(nproc)"
- Target Machine:
-
Start the Build:
bitbake microhil-image
-
Check the Generated File: After the build completes, the image will be available in:
build/tmp/deploy/images/raspberrypi5/
Example generated file:
core-image-microhil-raspberrypi5.wic.gz
-
Decompress the Image:
gunzip core-image-microhil-raspberrypi5.wic.gz
-
Flash the SD Card:
sudo dd if=core-image-microhil-raspberrypi5.wic of=/dev/sdX bs=4M status=progress conv=fsync
Replace
/dev/sdX
with the correct path to your SD card (uselsblk
to check). -
Insert the SD Card into your Raspberry Pi and boot it.
-
Connect via Ethernet (mDNS):
Default password:
changeme
(adjust in configuration if needed). -
Connect via Wi-Fi: Configure the
wpa_supplicant.conf
file if needed to join a Wi-Fi network.