This is a complete EXAMPLE PROJECT WITH GUIDE for creating a YOCTO build for RASPBERRY PI (RPI). The main target is RPI4, but with minimal edits it shall support any Yocto-supported RPI with HDMI. The project is up-to-date with the Detailed Manual pdf document, titled: "Manual for Custom Yocto-based minimal Linux Image for Raspberry Pi.pdf" This document and the project have several purposes: 1.) Describing how our demo project works, so that you can use it for your needs - from the build to the final usage on the RPI4B (Raspberry PI 4B). If you like it, we will be happy to get a star on GitHub :). You can also use the project for most RPI boards before 4B! Model 5 is not yet supported by Yocto. The project can also be built for QEMU, for which you don’t need HW. 2.) It is also a primer for anyone willing to step into Yocto to make his own build, for ANY of the already supported by Yocto HW platforms. 3.) In addition, it presents how this can be done on Manjaro, as it is not an officially Yocto-supported host distribution. With a few simple installations we can build Yocto projects flawlessly on Manjaro. We want to contribute by adding one more distribution to those which are officially approved. 4.) As a next point, it shows what standard SW we have integrated in our image, so that you know for what you can use our image. 5.) The project also presents how one can integrate a GUI application. In our case it is an IMGUI demo, based on OpenGL with GLFW2 and the X11 environment. 6.) Finally it briefly mentions Work orders / Project development for clients, Partnerships, Change requests, contributions, and fixes. Our image also includes a set of BusyBox GNU tools, SSH connection, HDMI setup, and WiFi connection script (which saves its values between reboots), which are all described. The document contains many sections, some of which are: 1. Non-tech Introduction _________________________________________________________________4 2. Yocto in 5 minutes from a technical perspective _______________________________________4 3. What do you need on Manjaro to run a Yocto build ______________________________________7 4. The RPI 4B Platform and the Display ___________________________________________________7 5. Yocto and Raspberry PI ________________________________________________________________8 7. Yocto versions and information, how to know what kernel version do we build from Poky _9 8. The BitBake build steps _______________________________________________________________10 9. Fetching the project and building it yourself - super easy, with only a few commands __12 10. Our project structure and bitbake basics _____________________________________________14 11. Starting the board ___________________________________________________________________21 Using halt and reboot ____________________________________________________________________22 Connecting via SSH _______________________________________________________________________22 12. Networking and starting the WiFi _____________________________________________________23 13. The SW provided by our image _________________________________________________________23 BusyBox, Shell, Init system, Libraries, X11, Avahi, Dropbear SSH, wpa_supplicant,... Looking for other modules, present or not. _______________________________________________26 Logs, Kernel, Editor, Clock 16. Processor, CPU Speed, and HW specification ___________________________________________26 17. Adding a module ______________________________________________________________________27 14. IMGUI DEMO ___________________________________________________________________________27 15. Changing for different HW ____________________________________________________________28 16. Important Yocto Links ________________________________________________________________28 17. License, development, and contribution _______________________________________________29 18. Change Requests, Bugs, Contributions, New Features ___________________________________30 19. Projects and work orders, partnerships _______________________________________________30 20. Copyright notice Important prerequisite - it is expected, that you have at least some basic Linux knowledge and/or experience (except for the Introduction). If you have none or would like to advance, I have written a book, called the Manjaro Linux User Guide, a top up-to-date book to learn Linux in 2024! It covers all general topics from the installation and graphical environments, through available SW, a great Terminal primer, package managers, encryption, Filesystem basics, Storage and backup, Networking and Sharing, Firewalls, Systemctl, Services, Shell scripts and automation, and others. 12 of its sub-sections are shared for free as articles! Take a look here: https://triplehelix-consulting.com/book/. Dependencies ============ URI: git@github.com:yoctoproject/poky.git branch: kirkstone URI: git@github.com:openembedded/meta-openembedded.git branch: kirkstone URI: git@github.com:agherzan/meta-raspberrypi branch: kirkstone URI: git@github.com:AtanasRusevTH/rpiconf-v1 branch: kirkstone Maintainer: Atanas Rusev <atanasr at triplehelix-consulting dot com> Short instruction ================= I. The easiest and fully AUTOMATIC way to work with the project ================================================= 1. Download the file /meta-thc/bin/metafetch-v1 2. Create a directory in your home, named, for example, yocto-rpi4-thc-v1. 3. Execute the script with these arguments: $ ./metafetch-v1 -b <BUILD_DIR> -m <METADATA_DIR> for the example this would be $ ./metafetch-v1 -b ~/yocto-rpi4-thc-v1/build -m ~/yocto-rpi4-thc-v1/metadata The script will clone all necessary dependencies and apply changes according to your local paths in the file ~/yocto-rpi4-thc-v1/build/conf/bblayers.conf By default the script clones via http, which is slower and may experience interrupts. The script also supports the git protocol. If you have a local git configuration in ~/.gitconfig, it can fetch via the git protocol. For this just add "-g" directly after the metafetch-v1 name. More is explained in the detailed pdf documentation. Next navigate to ~/yocto-rpi4-thc-v1/metadata/poky/ and execute: $ source oe-init-build-env <BUILD_DIR> For the example this would be: $ source oe-init-build-env ~/yocto-rpi4-thc-v1/build Now simply execute $ bitbake core-image-thc You will get a .wic file to be copied to the microSD card of your RPI board in: ~/yocto-rpi4-thc-v1/build/tmp/deploy/images/raspberrypi4-64/core-image-thc-raspberrypi4-64.wic Copy the file with: $ sudo dd if=/Path-To-File/core-image-thc-raspberrypi4-64.wic of=/dev/<xxx> status=progress Full details are available in the the Manual pdf. ================================================= Apart from this: ================================================= II. Adding the meta-thc layer to your build ================================================= Run 'bitbake-layers add-layer meta-thc'. III. Build ================================================= Run 'bitbake core-image-thc'. IV. Origin ================================================= This is the first stable version of https://github.com/kaloyanski/meta-thc. I freeze it as the original repository continues to be actively developed (as of Jan 2024). The documentation for the original repository is located at https://kaloyanski.github.io/meta-thc. Its updates will happen when Kaloyanski has time to do it. V. Message ================================================= If you are interested in this project, we will be glad to know and potentially collaborate. In this case, please contact <office at triplehelix-consulting dot com> You can also write via https://triplehelix-consulting.com/contact/
TripleHelixConsulting/meta-thc-v1
Complete yocto project for Raspberry PI with GUI, WiFi, SSH, Manual, Layers, and modules
BitBakeGPL-2.0