imagebuilder: add check if target is sourced from feed
authorFlorian Eckert <fe@dev.tdt.de>
Wed, 3 May 2023 11:29:42 +0000 (13:29 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 29 Mar 2024 19:00:27 +0000 (20:00 +0100)
The image generation would fail, if the target is included from a feed.
To fix this, check if targets is found in the feed directory.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Tested-by: Thomas Richard <thomas.richard@bootlin.com>
target/imagebuilder/files/Makefile

index 78ec7e2e94a94ebe10d374770b16330ee4014ad8..0466fc7dcc32687500c57818ecb37f7bd7529748 100644 (file)
@@ -205,8 +205,13 @@ build_image: FORCE
        @echo
        @echo Building images...
        rm -rf $(BUILD_DIR)/json_info_files/
-       $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
-               $(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)")
+       if [ -d "target/linux/feeds/$(BOARD)" ]; then \
+               $(NO_TRACE_MAKE) -C target/linux/feeds/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
+                       $(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)"); \
+       else \
+               $(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
+                       $(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)"); \
+       fi
 
 $(BIN_DIR)/profiles.json: FORCE
        $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \