diff options
authorGravatar Yann E. MORIN <yann.morin.1998@free.fr>2017-01-14 16:20:52 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2017-01-23 16:33:55 +0100
commit7979d1ba7126b4c02fcdbb5dd7685ecfd9664d80 (patch)
parentb13040fa27baf8fcb412aca3624fd1426ab598cc (diff)
core/br2-external: fix use of relative paths
Fixes #9576 When the path to a br2-external tree is relative, make enters an endless recursive loop (paths elided for brevity): $ make BR2_EXTERNAL=.. foo_defconfig make[1]: stat: ../configs/../configs/../configs[...]/toto_defconfig: Filename too long make[1]: *** No rule to make target '../configs/../configs/../configs[...]/toto_defconfig', needed by '../configs/../configs/../configs[...]/toto_defconfig'. Stop. Makefile:79: recipe for target '_all' failed make: *** [_all] Error 2 It is a bit complex to understand the actual technical reason for this never-ending expansion; it seems it happens in the code generated by the percent_defconfig macro. Not sure why, though... But the root cause is the relative path. Just use absolute, canonical paths to br2-external trees. Always. [Peter: add bugzilla reference] Reported-by: outtierbert@gmail.com Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com> (cherry picked from commit 05576fca13b129da8c7186ee2307981135d3391f)
1 files changed, 2 insertions, 1 deletions
diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 84bc334f77..26bcac8aa1 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -106,7 +106,8 @@ do_validate_one() {
error "'%s/Config.in': no such file or directory\n" "${br2_ext}"
- # Register this br2-external tree
+ # Register this br2-external tree, use an absolute canonical path
+ br2_ext="$( cd "${br2_ext}"; pwd )"
BR2_EXT_NAMES+=( "${br2_name}" )
eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\""
eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\""