diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-11-07 13:31:53 +0000 |
| commit | 8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch) | |
| tree | efdc32587159d0050a69009bdf2330a531727d95 /meta/classes-recipe/barebox.bbclass | |
| parent | d412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff) | |
| download | poky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz | |
The poky repository master branch is no longer being updated.
You can either:
a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs
b) use the new bitbake-setup
You can find information about either approach in our documentation:
https://docs.yoctoproject.org/
Note that "poky" the distro setting is still available in meta-yocto as
before and we continue to use and maintain that.
Long live Poky!
Some further information on the background of this change can be found
in: https://lists.openembedded.org/g/openembedded-architecture/message/2179
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/barebox.bbclass')
| -rw-r--r-- | meta/classes-recipe/barebox.bbclass | 162 |
1 files changed, 0 insertions, 162 deletions
diff --git a/meta/classes-recipe/barebox.bbclass b/meta/classes-recipe/barebox.bbclass deleted file mode 100644 index 73615999aa..0000000000 --- a/meta/classes-recipe/barebox.bbclass +++ /dev/null | |||
| @@ -1,162 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Copyright OpenEmbedded Contributors | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | |||
| 7 | inherit kernel-arch deploy cml1 pkgconfig | ||
| 8 | |||
| 9 | LICENSE ?= "GPL-2.0-only" | ||
| 10 | |||
| 11 | PROVIDES += "virtual/bootloader" | ||
| 12 | |||
| 13 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 14 | |||
| 15 | DEPENDS += "bison-native flex-native lz4-native" | ||
| 16 | |||
| 17 | S = "${UNPACKDIR}/barebox-${PV}" | ||
| 18 | B = "${WORKDIR}/build" | ||
| 19 | KBUILD_OUTPUT = "${B}" | ||
| 20 | OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT" | ||
| 21 | |||
| 22 | require conf/image-uefi.conf | ||
| 23 | |||
| 24 | # For some platforms and configuration, the barebox build process will require | ||
| 25 | # additional host tools that can be activated/deactivated here. | ||
| 26 | PACKAGECONFIG ??= "openssl libusb fit" | ||
| 27 | |||
| 28 | PACKAGECONFIG[openssl] = ",,openssl-native" | ||
| 29 | PACKAGECONFIG[libusb] = ",,libusb1-native" | ||
| 30 | PACKAGECONFIG[fit] = ",,u-boot-tools-native dtc-native" | ||
| 31 | |||
| 32 | export KBUILD_BUILD_USER ?= "oe-user" | ||
| 33 | export KBUILD_BUILD_HOST ?= "oe-host" | ||
| 34 | |||
| 35 | # unlike the kernel, barebox may build against host tools like openssl | ||
| 36 | export HOST_EXTRACFLAGS | ||
| 37 | |||
| 38 | def get_layer_rev(path): | ||
| 39 | try: | ||
| 40 | rev, _ = bb.process.run("git describe --match='' --always --dirty --broken", cwd=path) | ||
| 41 | except bb.process.ExecutionError: | ||
| 42 | rev = "" | ||
| 43 | return rev.strip() | ||
| 44 | |||
| 45 | BAREBOX_BUILDSYSTEM_VERSION[doc] = "Build system version to add to the barebox image. By default this is the git description of the containing layer." | ||
| 46 | BAREBOX_BUILDSYSTEM_VERSION ??= "${@get_layer_rev(os.path.dirname(d.getVar('FILE')))}" | ||
| 47 | |||
| 48 | BAREBOX_FIRMWARE_DIR[doc] = "Overwrite barebox' firmware blobs search directory (CONFIG_EXTRA_FIRMWARE_DIR) with this path, default ${B}/firmware" | ||
| 49 | BAREBOX_FIRMWARE_DIR ??= "${B}/firmware" | ||
| 50 | |||
| 51 | EXTRA_OEMAKE = " \ | ||
| 52 | CROSS_COMPILE=${TARGET_PREFIX} -C ${S} O=${B} \ | ||
| 53 | BUILDSYSTEM_VERSION=${BAREBOX_BUILDSYSTEM_VERSION} \ | ||
| 54 | CONFIG_EXTRA_FIRMWARE_DIR=${BAREBOX_FIRMWARE_DIR} \ | ||
| 55 | PKG_CONFIG=pkg-config-native \ | ||
| 56 | CROSS_PKG_CONFIG=pkg-config \ | ||
| 57 | " | ||
| 58 | |||
| 59 | BAREBOX_CONFIG[doc] = "The barebox kconfig defconfig file. Not used if a file called defconfig is added to the SRC_URI." | ||
| 60 | BAREBOX_CONFIG ?= "" | ||
| 61 | |||
| 62 | # set sensible default configs for some of oe-core's QEMU MACHINEs | ||
| 63 | BAREBOX_CONFIG:qemuarm = "multi_v7_defconfig" | ||
| 64 | BAREBOX_CONFIG:qemuarm64 = "multi_v8_defconfig" | ||
| 65 | BAREBOX_CONFIG:qemux86-64 = "efi_defconfig" | ||
| 66 | |||
| 67 | # prevent from acting as non-buildable provider | ||
| 68 | python () { | ||
| 69 | bareboxconfig = d.getVar('BAREBOX_CONFIG') | ||
| 70 | bareboxdefconfig = 'file://defconfig' in d.getVar('SRC_URI') | ||
| 71 | |||
| 72 | if not bareboxconfig and not bareboxdefconfig: | ||
| 73 | raise bb.parse.SkipRecipe("BAREBOX_CONFIG must be set in the %s machine configuration or file://defconfig must be given in SRC_URI." % d.getVar("MACHINE")) | ||
| 74 | } | ||
| 75 | |||
| 76 | barebox_do_configure() { | ||
| 77 | if [ -e ${UNPACKDIR}/defconfig ]; then | ||
| 78 | cp ${UNPACKDIR}/defconfig ${B}/.config | ||
| 79 | else | ||
| 80 | if [ -n "${BAREBOX_CONFIG}" ]; then | ||
| 81 | oe_runmake ${BAREBOX_CONFIG} | ||
| 82 | else | ||
| 83 | bbfatal "No defconfig given. Either add file 'file://defconfig' to SRC_URI or set BAREBOX_CONFIG" | ||
| 84 | fi | ||
| 85 | fi | ||
| 86 | |||
| 87 | ${S}/scripts/kconfig/merge_config.sh -m .config ${@" ".join(find_cfgs(d))} | ||
| 88 | cml1_do_configure | ||
| 89 | } | ||
| 90 | |||
| 91 | BAREBOX_ENV_DIR[doc] = "Overlay the barebox built-in environment with the environment provided by the BSP if specified." | ||
| 92 | BAREBOX_ENV_DIR ??= "${UNPACKDIR}/env/" | ||
| 93 | |||
| 94 | barebox_do_compile () { | ||
| 95 | export userccflags="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | ||
| 96 | unset LDFLAGS | ||
| 97 | unset CFLAGS | ||
| 98 | unset CPPFLAGS | ||
| 99 | unset CXXFLAGS | ||
| 100 | unset MACHINE | ||
| 101 | # Allow to use ${UNPACKDIR} in kconfig options to include additionally fetched files | ||
| 102 | export UNPACKDIR=${UNPACKDIR} | ||
| 103 | |||
| 104 | if [ -d ${BAREBOX_ENV_DIR} ]; then | ||
| 105 | BAREBOX_DEFAULT_ENV="$(grep ^CONFIG_DEFAULT_ENVIRONMENT_PATH .config | cut -d '=' -f 2 | tr -d '"')" | ||
| 106 | oe_runmake CONFIG_DEFAULT_ENVIRONMENT_PATH="\"${BAREBOX_DEFAULT_ENV} ${BAREBOX_ENV_DIR}\"" | ||
| 107 | else | ||
| 108 | oe_runmake | ||
| 109 | fi | ||
| 110 | } | ||
| 111 | |||
| 112 | BAREBOX_BINARY[doc] = "Specify the barebox binary to install. If not specified all barebox artifacts are installed." | ||
| 113 | BAREBOX_BINARY ??= "${@'barebox.efi' if d.getVar('EFI_PROVIDER') == 'barebox' else ''}" | ||
| 114 | BAREBOX_SUFFIX[doc] = "Specify the suffix for ${BAREBOX_IMAGE}." | ||
| 115 | BAREBOX_SUFFIX ??= "img" | ||
| 116 | BAREBOX_IMAGE[doc] = "A unique barebox image name. Unused if ${BAREBOX_BINARY} is not set." | ||
| 117 | BAREBOX_IMAGE_DEFAULT ?= "${PN}-${MACHINE}-${PV}-${PR}.${BAREBOX_SUFFIX}" | ||
| 118 | BAREBOX_IMAGE ?= "${@'${EFI_BOOT_IMAGE}' if d.getVar('EFI_PROVIDER') == 'barebox' else '${BAREBOX_IMAGE_DEFAULT}'}" | ||
| 119 | |||
| 120 | BAREBOX_INSTALL_PATH ?= "${@'${EFI_FILES_PATH}' if d.getVar('EFI_PROVIDER') == 'barebox' else '/boot'}" | ||
| 121 | |||
| 122 | barebox_do_install () { | ||
| 123 | if [ -n "${BAREBOX_BINARY}" ]; then | ||
| 124 | |||
| 125 | BAREBOX_BIN=${B}/${BAREBOX_BINARY} | ||
| 126 | if [ ! -f "${BAREBOX_BIN}" ]; then | ||
| 127 | BAREBOX_BIN=${B}/images/${BAREBOX_BINARY} | ||
| 128 | fi | ||
| 129 | if [ ! -f "${BAREBOX_BIN}" ]; then | ||
| 130 | bbfatal "Failed to locate ${BAREBOX_BINARY}" | ||
| 131 | fi | ||
| 132 | |||
| 133 | install -D -m 644 ${BAREBOX_BIN} ${D}${BAREBOX_INSTALL_PATH}/${BAREBOX_IMAGE} | ||
| 134 | ln -sf ${BAREBOX_IMAGE} ${D}${BAREBOX_INSTALL_PATH}/${BAREBOX_BINARY} | ||
| 135 | else | ||
| 136 | install -d ${D}${BAREBOX_INSTALL_PATH}/ | ||
| 137 | for image in $(cat ${B}/barebox-flash-images); do | ||
| 138 | install -m 644 ${B}/${image} ${D}${BAREBOX_INSTALL_PATH}/ | ||
| 139 | done | ||
| 140 | fi | ||
| 141 | } | ||
| 142 | FILES:${PN} = "${BAREBOX_INSTALL_PATH}" | ||
| 143 | |||
| 144 | barebox_do_deploy () { | ||
| 145 | if [ -n "${BAREBOX_BINARY}" ]; then | ||
| 146 | |||
| 147 | BAREBOX_BIN=${B}/${BAREBOX_BINARY} | ||
| 148 | if [ ! -f "${BAREBOX_BIN}" ]; then | ||
| 149 | BAREBOX_BIN=${B}/images/${BAREBOX_BINARY} | ||
| 150 | fi | ||
| 151 | |||
| 152 | install -D -m 644 ${BAREBOX_BIN} ${DEPLOYDIR}/${BAREBOX_IMAGE} | ||
| 153 | ln -sf ${BAREBOX_IMAGE} ${DEPLOYDIR}/${BAREBOX_BINARY} | ||
| 154 | else | ||
| 155 | for image in $(cat ${B}/barebox-flash-images); do | ||
| 156 | cp ${B}/${image} ${DEPLOYDIR} | ||
| 157 | done | ||
| 158 | fi | ||
| 159 | } | ||
| 160 | addtask deploy after do_compile | ||
| 161 | |||
| 162 | EXPORT_FUNCTIONS do_configure do_compile do_install do_deploy | ||
