Build basic YOCTO image for RaspberryPi - cu-ecen-aeld/yocto-assignments-base GitHub Wiki
Overview
- This page describes how to build basic Yocto image for RaspberryPi.
- A working example for the same can be found at this pull request
Implementation Steps
- Start by adding Yocto base from our assignment repo :
This specifies the base repository at https://github.com/cu-ecen-5013/yocto-assignments-base.git
git remote add yocto-assignments-base https://github.com/cu-ecen-5013/yocto-assignments-base.git
- fetch basic code from the base.
git fetch yocto-assignments-base
- make your master branch match the master branch of yocto-assignments-base
git merge yocto-assignments-base/master
- This command clones the assignment-autotest submodule and nested git repositories. (not compulsory if not planning to use existing testcases)
git submodule update --init --recursive
-
Install all required packages in ubuntu to establish Yocto environment based on the selected yocto branch (suggested to use the one used for yocto assignments) and the corresponding yocto system requirements page.
-
Add meta-raspberrypi(for raspberrypi machine), meta-openembedded(for meta-python and meta-networking - required for WiFi) and poky.
git submodule add https://git.yoctoproject.org/git/meta-raspberrypi meta-raspberrypi
git submodule add https://git.openembedded.org/meta-openembedded meta-openembedded
you can checkout specific poky branch as per your project requirements.
git submodule add git://git.yoctoproject.org/poky poky
-
Edit build.sh to specify image type to be generated, packages to be added to an image, add required meta layers etc. This all specifications will be added to conf/local.conf.
-
Build an image.
./build.sh
build.sh execution will take several hours. This will execute below command internally after updating local.conf.
bitbake core-image-base
This bitbake execution should show meta-raspberrypi layer or any new layer added in Build configuration as below:
Once execution completes without any issue, it will create an image at build/tmp/deploy/images/<machine_name>/<image_type_specified> depending on the type specified in build.sh file.
- Flash this image on SD card and bring up RaspberryPi with the image flashed on SD card.
Use any imager software for this. Example:Raspberry Pi Imager
You may also use the dd
command.
Output
Once RaspberryPi booting completes, one should get above login prompt. Login with root as login id. Password is not required.