toplevel.mk: make sure tmp exist for .packagedynamicdefault
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 12 Jun 2024 13:55:17 +0000 (15:55 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 12 Jun 2024 13:55:17 +0000 (15:55 +0200)
With some big corner case, tmp directory might not exist when
check-dynamic-def-pkg is called. To handle this, make sure tmp exist
before creating the .packagedynamicdefault file.

Fixes: 9a52ec4fa092 ("toplevel.mk: implement logic to invalidate targetinfo with some config")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
include/toplevel.mk

index f711a306144746e94f7839674f0d132faa011cbe..54cd8e3a908cffe09dd226c0c695d5d01c223f1f 100644 (file)
@@ -88,7 +88,7 @@ check-dynamic-def-pkg: FORCE
        fi; \
        [ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \
        [ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \
-       echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;
+       mkdir -p tmp && echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;
 
 prepare-tmpinfo: check-dynamic-def-pkg FORCE
        @+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)