Message ID | 20240910184143.2820792-1-ejo@pengutronix.de |
---|---|
Headers | show |
Series | Add barebox bootloader support (and testing) | expand |
Am Dienstag, dem 10.09.2024 um 20:41 +0200 schrieb Enrico Jörns: > + > +do_configure() { > + if [ -e ${WORKDIR}/defconfig ]; then > + cp ${WORKDIR}/defconfig ${B}/.config Just noted in other tests against actual BSPs that this check is not yet adapted to UNPACKDIR. Will send a v6. Regards, Enrico > + else > + if [ -n "${BAREBOX_CONFIG}" ]; then > + oe_runmake ${BAREBOX_CONFIG} > + else > + bbfatal "No defconfig given. Either add file 'file://defconfig' to > SRC_URI or set BAREBOX_CONFIG" > + fi > + fi > + > + ${S}/scripts/kconfig/merge_config.sh -m .config ${@" ".join(find_cfgs(d))} > + cml1_do_configure > +} > + > +BAREBOX_ENV_DIR[doc] = "Overlay the barebox built-in environment with the environment provided by > the BSP if specified." > +BAREBOX_ENV_DIR ??= "${WORKDIR}/env/" > + > +do_compile () { > + export userccflags="${TARGET_LDFLAGS}${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" > + unset LDFLAGS > + unset CFLAGS > + unset CPPFLAGS > + unset CXXFLAGS > + unset MACHINE > + > + if [ -d ${BAREBOX_ENV_DIR} ]; then > + BAREBOX_DEFAULT_ENV="$(grep ^CONFIG_DEFAULT_ENVIRONMENT_PATH .config | cut -d '=' > -f 2 | tr -d '"')" > + oe_runmake CONFIG_DEFAULT_ENVIRONMENT_PATH="\"${BAREBOX_DEFAULT_ENV} > ${BAREBOX_ENV_DIR}\"" > + else > + oe_runmake > + fi > +} > + > +BAREBOX_BINARY[doc] = "Specify the barebox binary to install. If not specified all barebox > artifacts are installed." > +BAREBOX_BINARY ??= "${@'barebox.efi' if d.getVar('EFI_PROVIDER') == 'barebox' else ''}" > +BAREBOX_SUFFIX[doc] = "Specify the suffix for ${BAREBOX_IMAGE}." > +BAREBOX_SUFFIX ??= "img" > +BAREBOX_IMAGE[doc] = "A unique barebox image name. Unused if ${BAREBOX_BINARY} is not set." > +BAREBOX_IMAGE_DEFAULT ?= "${PN}-${MACHINE}-${PV}-${PR}.${BAREBOX_SUFFIX}" > +BAREBOX_IMAGE ?= "${@'${EFI_BOOT_IMAGE}' if d.getVar('EFI_PROVIDER') == 'barebox' else > '${BAREBOX_IMAGE_DEFAULT}'}" > + > +BAREBOX_INSTALL_PATH ?= "${@'${EFI_FILES_PATH}' if d.getVar('EFI_PROVIDER') == 'barebox' else > '/boot'}" > + > +do_install () { > + if [ -n "${BAREBOX_BINARY}" ]; then > + > + BAREBOX_BIN=${B}/${BAREBOX_BINARY} > + if [ ! -f "${BAREBOX_BIN}" ]; then > + BAREBOX_BIN=${B}/images/${BAREBOX_BINARY} > + fi > + if [ ! -f "${BAREBOX_BIN}" ]; then > + bbfatal "Failed to locate ${BAREBOX_BINARY}" > + fi > + > + install -D -m 644 ${BAREBOX_BIN} ${D}${BAREBOX_INSTALL_PATH}/${BAREBOX_IMAGE} > + ln -sf ${BAREBOX_IMAGE} ${D}${BAREBOX_INSTALL_PATH}/${BAREBOX_BINARY} > + else > + install -d ${D}${BAREBOX_INSTALL_PATH}/ > + for image in $(cat ${B}/barebox-flash-images); do > + install -m 644 ${B}/${image} ${D}${BAREBOX_INSTALL_PATH}/ > + done > + fi > +} > +FILES:${PN} = "${BAREBOX_INSTALL_PATH}" > + > +do_deploy () { > + if [ -n "${BAREBOX_BINARY}" ]; then > + > + BAREBOX_BIN=${B}/${BAREBOX_BINARY} > + if [ ! -f "${BAREBOX_BIN}" ]; then > + BAREBOX_BIN=${B}/images/${BAREBOX_BINARY} > + fi > + > + install -D -m 644 ${BAREBOX_BIN} ${DEPLOYDIR}/${BAREBOX_IMAGE} > + ln -sf ${BAREBOX_IMAGE} ${DEPLOYDIR}/${BAREBOX_BINARY} > + else > + for image in $(cat ${B}/barebox-flash-images); do > + cp ${B}/${image} ${DEPLOYDIR} > + done > + fi > +} > +addtask deploy after do_compile > diff --git a/meta/recipes-bsp/barebox/barebox_2024.08.0.bb b/meta/recipes- > bsp/barebox/barebox_2024.08.0.bb > new file mode 100644 > index 0000000000..1a7bbbccaa > --- /dev/null > +++ b/meta/recipes-bsp/barebox/barebox_2024.08.0.bb > @@ -0,0 +1,3 @@ > +require barebox.inc > + > +SRC_URI[sha256sum] = "b08a762da8d63dd18b4f2d9f5d0a8da001b6e608d1b3eff6dcebc6a2e575d535" > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#204367): https://lists.openembedded.org/g/openembedded-core/message/204367 > Mute This Topic: https://lists.openembedded.org/mt/108380782/3616721 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ejo@pengutronix.de] > -=-=-=-=-=-=-=-=-=-=-=- >