From b816ac8704b3a32eba82e7f2b12c439248ae2528 Mon Sep 17 00:00:00 2001 From: Adam Miartus Date: Sun, 10 May 2020 20:21:12 +0200 Subject: toybox: allow user to provide own defconfig toybox provides similar scheme with defconfig as linux and busybox, allow user to override the defconfig in their own layer copy paste from kernel.bbclass Signed-off-by: Adam Miartus Signed-off-by: Khem Raj --- meta-oe/recipes-core/toybox/toybox_0.7.5.bb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-core/toybox/toybox_0.7.5.bb b/meta-oe/recipes-core/toybox/toybox_0.7.5.bb index 069f0471c0..2f82978334 100644 --- a/meta-oe/recipes-core/toybox/toybox_0.7.5.bb +++ b/meta-oe/recipes-core/toybox/toybox_0.7.5.bb @@ -20,7 +20,18 @@ TOYBOX_BIN = "generated/unstripped/toybox" EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()}' do_configure() { - oe_runmake defconfig + # allow user to define their own defconfig in bbappend, taken from kernel.bbclass + if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then + mv "${S}/.config" "${B}/.config" + fi + + # Copy defconfig to .config if .config does not exist. This allows + # recipes to manage the .config themselves in do_configure_prepend(). + if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then + cp "${WORKDIR}/defconfig" "${B}/.config" + fi + + oe_runmake oldconfig || oe_runmake defconfig # Disable killall5 as it isn't managed by update-alternatives sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config -- cgit v1.2.3-54-g00ecf