# #Yocto - Build-system for the Linux kernel # #Yocto runs on Linux only, because it depends on a plethora of command line #utilities and Python version 2.7. Another fine mess created by the UNIX #"toolkit" philosophy, complete with a bag of seeds to organically grow a #"build machine" which eventually nobody knows the specs for. We must pretend #to subscribe to the idea of the build machine in order to take advantage of #Yocto to build a customized Linux kernel. This file completely automates #setting up a Yocto build environment, thereby ensuring that the Yocto #environment is set up in exactly the same way every time. # #NOTE NOTE NOTE #There are no BUILD_COMMANDs defined here. The modules defined here will #simply install everything we need in order to run bitbake with a number of #Bitbake layers. We must invoke bitbake manually. Bitbake may then in turn #invoke cmake in order to build any user level code we have defined in any #.bb layers we may have introduced. That user level code will be included in #the bootable SD card image generated by bitbake. # #The Yocto system and all layers go under UNPACKED_ROOT set (UNPACKED_ROOT "${CMAKE_INSTALL_PREFIX}/yocto") ExternalProject_Add ( yocto PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/poky BUILD_IN_SOURCE 1 URL http://downloads.yoctoproject.org/releases/yocto/yocto-3.1.12/poky-dunfell-23.0.12.tar.bz2 URL_MD5 92cc07d8b0b85456dd9f523f5c366433 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) ExternalProject_Add ( yocto-openembedded PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/meta-openembedded BUILD_IN_SOURCE 1 URL http://downloads.yoctoproject.org/releases/yocto/yocto-3.1.12/meta-openembedded-dunfell-23.0.12.tar.bz2 URL_MD5 2d368ec91815140eaa0a30f04dfe4a55 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS yocto ) #Yocto Board Support Package (BSP) for Linux on Raspberry Pi ExternalProject_Add ( yocto-raspberrypi PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/meta-raspberrypi BUILD_IN_SOURCE 1 # URL https://github.com/agherzan/meta-raspberrypi/archive/dunfell.zip # Head of the Dunfell branch per 14dec21 is URL https://github.com/agherzan/meta-raspberrypi/archive/934064a01903b2ba9a82be93b3f0efdb4543a0e8.zip URL_MD5 fc0487669bf98ac028333334e6f9de19 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS yocto-openembedded ) ExternalProject_Add ( yocto-hifiberry-rpi PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/meta-hifiberry-rpi BUILD_IN_SOURCE 1 # Head of the master branch per 28dec21 is URL https://github.com/mickey-happygolucky/meta-hifiberry-rpi/archive/5f71b99431e3b18db06040fd712618d871e3ebf9.zip URL_MD5 ed4b90c6e8b16da0118a30197f64947e CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS yocto-openembedded ) #Command to invoke "bitbake". Sets all required environment variables first. #For example: "${BITBAKE_CMD} core-image-minimal -c populate_sdk_ext" set (BITBAKE_CMD "${CMAKE_COMMAND} chdir ${UNPACKED_ROOT}/poky source ./oe-init-build-env && bitbake" PARENT_SCOPE) #For use by other OSD modules that need to install their own Yocto layers. #Yocto layer "A" must be installed under "${YOCTO_ROOT}/A". set (YOCTO_ROOT "${UNPACKED_ROOT}" PARENT_SCOPE)