]>
Commit | Line | Data |
---|---|---|
742a207e SL |
1 | From 139b2cf1566157c80c76ddce89f9d18f82b51720 Mon Sep 17 00:00:00 2001 |
2 | From: Masahiro Yamada <yamada.masahiro@socionext.com> | |
3 | Date: Mon, 5 Nov 2018 16:52:34 +0900 | |
4 | Subject: kbuild: deb-pkg: fix bindeb-pkg breakage when O= is used | |
5 | ||
6 | [ Upstream commit 02826a6ba301b72461c3706e1cc66d5571cd327e ] | |
7 | ||
8 | Ard Biesheuvel reports bindeb-pkg with O= option is broken in the | |
9 | following way: | |
10 | ||
11 | ... | |
12 | LD [M] sound/soc/rockchip/snd-soc-rk3399-gru-sound.ko | |
13 | LD [M] sound/soc/rockchip/snd-soc-rockchip-pcm.ko | |
14 | LD [M] sound/soc/rockchip/snd-soc-rockchip-rt5645.ko | |
15 | LD [M] sound/soc/rockchip/snd-soc-rockchip-spdif.ko | |
16 | LD [M] sound/soc/sh/rcar/snd-soc-rcar.ko | |
17 | fakeroot -u debian/rules binary | |
18 | make KERNELRELEASE=4.19.0-12677-g19beffaf7a99-dirty ARCH=arm64 KBUILD_SRC= intdeb-pkg | |
19 | /bin/bash /home/ard/linux/scripts/package/builddeb | |
20 | Makefile:600: include/config/auto.conf: No such file or directory | |
21 | *** | |
22 | *** Configuration file ".config" not found! | |
23 | *** | |
24 | *** Please run some configurator (e.g. "make oldconfig" or | |
25 | *** "make menuconfig" or "make xconfig"). | |
26 | *** | |
27 | make[12]: *** [syncconfig] Error 1 | |
28 | make[11]: *** [syncconfig] Error 2 | |
29 | make[10]: *** [include/config/auto.conf] Error 2 | |
30 | make[9]: *** [__sub-make] Error 2 | |
31 | ... | |
32 | ||
33 | Prior to commit 80463f1b7bf9 ("kbuild: add --include-dir flag only | |
34 | for out-of-tree build"), both srctree and objtree were added to | |
35 | --include-dir redundantly, and the wrong code '$MAKE image_name' | |
36 | was working by relying on that. Now, the potential issue that had | |
37 | previously been hidden just showed up. | |
38 | ||
39 | '$MAKE image_name' recurses to the generated $(objtree)/Makefile and | |
40 | ends up with running in srctree, which is incorrect. It should be | |
41 | invoked with '-f $srctree/Makefile' (or KBUILD_SRC=) to be executed | |
42 | in objtree. | |
43 | ||
44 | Fixes: 80463f1b7bf9 ("kbuild: add --include-dir flag only for out-of-tree build") | |
45 | Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> | |
46 | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> | |
47 | Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> | |
48 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
49 | --- | |
50 | scripts/package/builddeb | 2 +- | |
51 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
52 | ||
53 | diff --git a/scripts/package/builddeb b/scripts/package/builddeb | |
54 | index 90c9a8ac7adb..0b31f4f1f92c 100755 | |
55 | --- a/scripts/package/builddeb | |
56 | +++ b/scripts/package/builddeb | |
57 | @@ -81,7 +81,7 @@ else | |
58 | cp System.map "$tmpdir/boot/System.map-$version" | |
59 | cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" | |
60 | fi | |
61 | -cp "$($MAKE -s image_name)" "$tmpdir/$installed_image_path" | |
62 | +cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" | |
63 | ||
64 | if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then | |
65 | # Only some architectures with OF support have this target | |
66 | -- | |
67 | 2.19.1 | |
68 |