# #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.0.2/poky-zeus-22.0.2.tar.bz2 URL_MD5 5a02a7114bc7e9d28d044f8a801c1f06 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 https://github.com/openembedded/meta-openembedded/archive/zeus.zip # Head of the Zeus branch per 24apr20 is URL https://github.com/openembedded/meta-openembedded/archive/9e60d30669a2ad0598e9abf0cd15ee06b523986b.zip URL_MD5 a35da1e4973b4611742f4fa2f2e38195 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS yocto ) #To prevent wearing out the SD card on platforms where the boot medium is an #SD card. All updates to the local bootable file system on the SD card will be #conceptually "rolled back" following a system restart. ExternalProject_Add ( yocto-readonly-rootfs-overlay PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/meta-readonly-rootfs-overlay BUILD_IN_SOURCE 1 # URL https://github.com/cmhe/meta-readonly-rootfs-overlay/archive/master.zip # Head of the Master branch per 04may2020 is URL https://github.com/cmhe/meta-readonly-rootfs-overlay/archive/735aba8682471193d631eb08602b772b6c41cbb7.zip URL_MD5 d7dec15911aa2901885f084922a22bdf CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" DEPENDS yocto-openembedded ) #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/zeus.zip # Head of the Zeus branch per 24apr20 is URL https://github.com/agherzan/meta-raspberrypi/archive/0e05098853eea77032bff9cf81955679edd2f35d.zip URL_MD5 874fe5f9fd2524ccb84e6513d21c4f57 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 ) #Yocto Board Support Package (BSP) for Linux on Beagleboard ExternalProject_Add ( yocto-beagleboard PREFIX ${CMAKE_INSTALL_PREFIX} SOURCE_DIR ${UNPACKED_ROOT}/meta-beagleboard BUILD_IN_SOURCE 1 URL https://github.com/beagleboard/meta-beagleboard/archive/1.0.0.zip URL_MD5 459344cd3f6629f707d11e4d4bc04684 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)