diff options
author | Martin Kelly <mkelly@xevo.com> | 2017-11-17 15:48:41 -0800 |
---|---|---|
committer | Andrei Gherzan <andrei@gherzan.com> | 2018-01-31 20:38:58 +0000 |
commit | 8643e28c3a6ac72ed19e98b36a9b113e22c87a06 (patch) | |
tree | a7e8596d32d7f89cc4a45420fd8af37e6355f81b | |
parent | dfa7f00bab4fadcf048e338420e724d777de938b (diff) | |
download | meta-raspberrypi-8643e28c3a6ac72ed19e98b36a9b113e22c87a06.tar.gz |
linux-raspberrypi: fix build with devtool
Currently, building linux-raspberrypi with "devtool build" breaks
because ${B}.config doesn't yet exist when do_configure_prepend runs.
Fix this by taking some logic from kernel.bbclass do_configure to populate
${B}.config before do_configure_prepend.
The full explanation for why this is necessary is fairly complex:
- In devtool builds, externalsrc.bbclass gets inherited and sets a list of
SRCTREECOVEREDTASKS, which don't get run because they affect the source tree
and, when using devtool, we want the developer's changes to be the single
source of truth. kernel-yocto.bbclass adds do_kernel_configme to
SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal
non-devtool build, do_kernel_configme creates ${B}.config.
- Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme
doesn't run, because the first few lines of do_configure in kernel.bbclass
populate ${B}.config from either ${S}.config (if it exists) for custom
developer changes, or otherwise from ${WORDIR}/defconfig.
- In linux-raspberrypi, we add do_configure_prepend, which tweaks
${B}.config. Since this runs *before* the kernel.bbclass do_configure,
${B}.config doesn't yet exist and we hit an error. Thus we need to move
the logic from do_configure up to before our do_configure_prepend. Because
we are copying only a portion of do_configure and not the whole thing,
there is no clean way to do it using OE functionality, so we just
copy-and-paste.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
-rw-r--r-- | recipes-kernel/linux/linux-raspberrypi.inc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-raspberrypi.inc b/recipes-kernel/linux/linux-raspberrypi.inc index 040cf88..47d7efa 100644 --- a/recipes-kernel/linux/linux-raspberrypi.inc +++ b/recipes-kernel/linux/linux-raspberrypi.inc | |||
@@ -61,7 +61,43 @@ kernel_configure_variable() { | |||
61 | fi | 61 | fi |
62 | } | 62 | } |
63 | 63 | ||
64 | config_setup() { | ||
65 | # From kernel.bbclass. Unfortunately, this is needed to support builds that | ||
66 | # use devtool. The reason is as follows: | ||
67 | # | ||
68 | # - In devtool builds, externalsrc.bbclass gets inherited and sets a list of | ||
69 | # SRCTREECOVEREDTASKS, which don't get run because they affect the source | ||
70 | # tree and, when using devtool, we want the developer's changes to be the | ||
71 | # single source of truth. kernel-yocto.bbclass adds do_kernel_configme to | ||
72 | # SRCTREECOVEREDTASKS, so it doesn't run in a devtool build., In a normal | ||
73 | # non-devtool build, do_kernel_configme creates ${B}.config. | ||
74 | # | ||
75 | # - Normally (e.g. in linux-yocto), it would be OK that do_kernel_configme | ||
76 | # doesn't run, because the first few lines of do_configure in kernel.bbclass | ||
77 | # populate ${B}.config from either ${S}.config (if it exists) for custom | ||
78 | # developer changes, or otherwise from ${WORDIR}/defconfig. | ||
79 | # | ||
80 | # - In linux-raspberrypi, we add do_configure_prepend, which tweaks | ||
81 | # ${B}.config. Since this runs *before* the kernel.bbclass do_configure, | ||
82 | # ${B}.config doesn't yet exist and we hit an error. Thus we need to move | ||
83 | # the logic from do_configure up to before our do_configure_prepend. Because | ||
84 | # we are copying only a portion of do_configure and not the whole thing, | ||
85 | # there is no clean way to do it using OE functionality, so we just | ||
86 | # copy-and-paste. | ||
87 | if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then | ||
88 | mv "${S}/.config" "${B}/.config" | ||
89 | fi | ||
90 | |||
91 | # Copy defconfig to .config if .config does not exist. This allows | ||
92 | # recipes to manage the .config themselves in do_configure_prepend(). | ||
93 | if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then | ||
94 | cp "${WORKDIR}/defconfig" "${B}/.config" | ||
95 | fi | ||
96 | } | ||
97 | |||
64 | do_configure_prepend() { | 98 | do_configure_prepend() { |
99 | config_setup | ||
100 | |||
65 | mv -f ${B}/.config ${B}/.config.patched | 101 | mv -f ${B}/.config ${B}/.config.patched |
66 | CONF_SED_SCRIPT="" | 102 | CONF_SED_SCRIPT="" |
67 | 103 | ||