summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-11-10 10:37:50 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2015-11-13 10:50:52 +0100
commit98e6a997e31bec11385db903d66c908936da1019 (patch)
tree135ee2caea0d39421c3865ea52efe6789bc4b3d9
parent5cee635099d2c6bea6f36dd7c98a32a58c581378 (diff)
downloadmeta-phytec-98e6a997e31bec11385db903d66c908936da1019.tar.bz2
meta-phytec-98e6a997e31bec11385db903d66c908936da1019.zip
layer: Refactor DEFCONFIG variable handling
DEFAULT_DEFCONFIG variables are now called INTREE_DEFCONFIG and are handled by the kconfig class. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--classes/kconfig-prepare-configure.bbclass4
-rw-r--r--classes/kconfig.bbclass13
-rw-r--r--conf/machine/include/phyam335x.inc6
-rw-r--r--conf/machine/include/phyimx6.inc4
-rw-r--r--recipes-bsp/barebox/barebox-ipl.inc7
-rw-r--r--recipes-bsp/barebox/barebox.inc7
-rw-r--r--recipes-kernel/linux/linux-common.inc8
7 files changed, 20 insertions, 29 deletions
diff --git a/classes/kconfig-prepare-configure.bbclass b/classes/kconfig-prepare-configure.bbclass
index 69ce04a..dc9f453 100644
--- a/classes/kconfig-prepare-configure.bbclass
+++ b/classes/kconfig-prepare-configure.bbclass
@@ -3,7 +3,7 @@
# Released under the MIT license (see COPYING.MIT for the terms)
# FIXME Recipes, which use the bbclass, must define the task
-# 'do_default_defconfig' by themselfs.
+# 'do_intree_defconfig' by themselfs.
# returns and .cfg filenames from SRC_URI
def find_sccs(d):
@@ -28,7 +28,7 @@ do_configure_prepend() {
bbnote "No defconfig file provided for the recipe"
if test ! -f "$config"; then
bbnote "recipe is not configured"
- do_default_defconfig
+ do_intree_defconfig
fi
fi
diff --git a/classes/kconfig.bbclass b/classes/kconfig.bbclass
index 3e9c298..3a40730 100644
--- a/classes/kconfig.bbclass
+++ b/classes/kconfig.bbclass
@@ -1,5 +1,12 @@
inherit cml1
+# these variables can be configured in the recipes inheriting kconfig
+INTREE_DEFCONFIG ??= ""
+
+# class variables
+KBUILD_OUTPUT = "${B}"
+KBUILD_OUTPUT[export] = "1"
+
kconfig_set() {
bbnote "Setting $1 in .config to $2"
if [ "$2" == "n" ]; then
@@ -14,3 +21,9 @@ kconfig_set() {
echo "$line" >> ${B}/.config
fi
}
+
+do_intree_defconfig () {
+ bbnote "generating .config for target ${INTREE_DEFCONFIG}"
+ unset CFLAGS LDFLAGS
+ oe_runmake -C ${S} ${INTREE_DEFCONFIG}
+}
diff --git a/conf/machine/include/phyam335x.inc b/conf/machine/include/phyam335x.inc
index d8c611d..35b14e8 100644
--- a/conf/machine/include/phyam335x.inc
+++ b/conf/machine/include/phyam335x.inc
@@ -13,8 +13,8 @@ PACKAGE_EXTRA_ARCHS_append = " ${MACHINE_SOCARCH}"
# Bootloader
PREFERRED_PROVIDER_virtual/bootloader ?= "barebox"
PREFERRED_PROVIDER_virtual/prebootloader ?= "barebox-ipl"
-BAREBOX_DEFAULT_DEFCONFIG = "am335x_defconfig"
-BAREBOX_IPL_DEFAULT_DEFCONFIG = "am335x_mlo_defconfig"
+INTREE_DEFCONFIG_pn-barebox = "am335x_defconfig"
+INTREE_DEFCONFIG_pn-barebox-ipl = "am335x_mlo_defconfig"
BAREBOX_IPL_IMAGE_BASE_NAME = "MLO-${MACHINE}-${PKGV}-${PKGR}-${DATETIME}"
BAREBOX_IPL_BIN_SYMLINK = "MLO"
# all am335x need an mlo, whenever we need a bootloader
@@ -25,7 +25,7 @@ DEPENDS_pn-u-boot_append = " virtual/prebootloader"
# Kernel
PREFERRED_PROVIDER_virtual/kernel ?= "linux-ti"
KERNEL_IMAGETYPE ?= "zImage"
-KERNEL_DEFAULT_DEFCONFIG = "am335x_phytec_defconfig"
+INTREE_DEFCONFIG_pn-linux-ti = "am335x_phytec_defconfig"
# Install modules in initramfs and rootfs
PACKAGE_INSTALL_append = " kernel-modules"
diff --git a/conf/machine/include/phyimx6.inc b/conf/machine/include/phyimx6.inc
index 5776572..466c14b 100644
--- a/conf/machine/include/phyimx6.inc
+++ b/conf/machine/include/phyimx6.inc
@@ -7,12 +7,12 @@ SOC_FAMILY = "mx6"
#Bootloader
PREFERRED_PROVIDER_virtual/bootloader ?= "barebox"
-BAREBOX_DEFAULT_DEFCONFIG = "imx_v7_defconfig"
+INTREE_DEFCONFIG_pn-barebox = "imx_v7_defconfig"
# Kernel
PREFERRED_PROVIDER_virtual/kernel ?= "linux-mainline"
KERNEL_IMAGETYPE ?= "zImage"
-KERNEL_DEFAULT_DEFCONFIG = "imx_v6_v7_defconfig"
+INTREE_DEFCONFIG_pn-linux-mainline = "imx_v6_v7_defconfig"
# Install modules in initramfs and roofs
PACKAGE_INSTALL_append = " kernel-modules"
diff --git a/recipes-bsp/barebox/barebox-ipl.inc b/recipes-bsp/barebox/barebox-ipl.inc
index 229cd13..ea3b9b4 100644
--- a/recipes-bsp/barebox/barebox-ipl.inc
+++ b/recipes-bsp/barebox/barebox-ipl.inc
@@ -15,19 +15,12 @@ BAREBOX_IPL_BIN ?= "barebox.bin"
BAREBOX_IPL_IMAGE_BASE_NAME ?= "IPL-${MACHINE}-${PKGV}-${PKGR}-${DATETIME}"
BAREBOX_IPL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
BAREBOX_IPL_BIN_SYMLINK ?= "IPL"
-BAREBOX_IPL_DEFAULT_DEFCONFIG ?= ""
# dont use the environment prepare function from barebox
python do_prepare_env() {
return
}
-do_default_defconfig () {
- bbnote "generating .config for target ${BAREBOX_IPL_DEFAULT_DEFCONFIG}"
- unset CFLAGS LDFLAGS
- oe_runmake ${BAREBOX_IPL_DEFAULT_DEFCONFIG}
-}
-
do_install () {
bbnote "Installing barebox-ipl image on target rootfs"
install -d ${D}${base_bootdir}
diff --git a/recipes-bsp/barebox/barebox.inc b/recipes-bsp/barebox/barebox.inc
index 413d832..253e242 100644
--- a/recipes-bsp/barebox/barebox.inc
+++ b/recipes-bsp/barebox/barebox.inc
@@ -45,7 +45,6 @@ BAREBOX_BIN ?= "barebox.bin"
BAREBOX_IMAGE_BASE_NAME ?= "barebox-${MACHINE}-${PKGV}-${PKGR}-${DATETIME}"
BAREBOX_IMAGE_BASE_NAME[vardepsexclude] += "DATETIME"
BAREBOX_BIN_SYMLINK ?= "barebox.bin"
-BAREBOX_DEFAULT_DEFCONFIG ?= ""
# recipe private variables
BAREBOX_COMMON_ENVDIR = "${WORKDIR}/commonenv"
@@ -99,12 +98,6 @@ python do_prepare_env() {
}
addtask prepare_env after do_patch before do_configure
-do_default_defconfig () {
- bbnote "generating .config for target ${BAREBOX_DEFAULT_DEFCONFIG}"
- unset CFLAGS LDFLAGS
- oe_runmake ${BAREBOX_DEFAULT_DEFCONFIG}
-}
-
do_compile () {
unset CFLAGS LDFLAGS
oe_runmake all
diff --git a/recipes-kernel/linux/linux-common.inc b/recipes-kernel/linux/linux-common.inc
index 8d06be9..55451dd 100644
--- a/recipes-kernel/linux/linux-common.inc
+++ b/recipes-kernel/linux/linux-common.inc
@@ -18,9 +18,6 @@ PATCHTOOL = "git"
KERNEL_CONFIG_COMMAND = "oe_runmake -C ${S} O=${B} olddefconfig"
-# these variables need to be assigned in the machine.conf
-KERNEL_DEFAULT_DEFCONFIG ?= ""
-
# Copy .dts iand .dtsi from SRC_URI to the kernel boot/dts path
# This should go to poky/meta/recipes-kernel/linux/linux-dtb.inc
# returns all the elements from the src uri that are .dts or .dtsi files
@@ -75,11 +72,6 @@ do_configure_append() {
kconfig_set LOCALVERSION "${LINUX_VERSION_EXTENSION}"
}
-do_default_defconfig () {
- bbnote "generating .config for target ${KERNEL_DEFAULT_DEFCONFIG}"
- oe_runmake -C ${S} O=${B} ${KERNEL_DEFAULT_DEFCONFIG}
-}
-
KERNEL_IMAGE_BASE_NAME = "${KERNEL_IMAGETYPE}-${PN}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
do_deploy_append() {
install -m 644 ${B}/.config ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.config