imagebuilder: strip DEVICE_ prefix from profiles (FS#55)
authorFelix Fietkau <nbd@nbd.name>
Thu, 21 Jul 2016 11:41:20 +0000 (13:41 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 21 Jul 2016 11:41:20 +0000 (13:41 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
include/image.mk
target/imagebuilder/files/Makefile

index 43c144ad34270dd27e872d0b9f366a4f3648878e..47cb1a58a9c1a5a5bac2ff4f980dd557cc255198 100644 (file)
@@ -327,7 +327,7 @@ define Device/Export
 endef
 
 ifdef IB
-  DEVICE_CHECK_PROFILE = $(filter $(1),$(PROFILE))
+  DEVICE_CHECK_PROFILE = $(filter $(1),DEVICE_$(PROFILE) $(PROFILE))
 else
   DEVICE_CHECK_PROFILE = $(CONFIG_TARGET_$(if $(CONFIG_TARGET_MULTI_PROFILE),DEVICE_)$(call target_conf,$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET)))_$(1))
 endif
index 64f21b887108ea95d2ef9743148705828172f893..4ae02973554a588d56d7cf4dc4277d0205ddaa4b 100644 (file)
@@ -77,7 +77,7 @@ include $(INCLUDE_DIR)/target.mk
 
 USER_PROFILE ?= $(firstword $(PROFILE_NAMES))
 PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \
-       echo '$(p):'; $(if $($(p)_NAME),echo '    $($(p)_NAME)'; ) echo '    Packages: $($(p)_PACKAGES)'; \
+       echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo '    $($(p)_NAME)'; ) echo '    Packages: $($(p)_PACKAGES)'; \
 )
 
 .profiles.mk: .targetinfo
@@ -180,9 +180,11 @@ clean:
 info:
        (unset PROFILE FILES PACKAGES MAKEFLAGS; $(MAKE) -s _call_info)
 
+PROFILE_FILTER = $(filter DEVICE_$(PROFILE) $(PROFILE),$(PROFILE_NAMES))
+
 image:
 ifneq ($(PROFILE),)
-  ifeq ($(filter $(PROFILE),$(PROFILE_NAMES)),)
+  ifeq ($(PROFILE_FILTER),)
        @echo 'Profile "$(PROFILE)" does not exist!'
        @echo 'Use "make info" to get a list of available profile names.'
        @exit 1
@@ -190,7 +192,7 @@ ifneq ($(PROFILE),)
 endif
        (unset PROFILE FILES PACKAGES MAKEFLAGS; \
        $(MAKE) _call_image \
-               $(if $(PROFILE),USER_PROFILE="$(PROFILE)") \
+               $(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
                $(if $(FILES),USER_FILES="$(FILES)") \
                $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
                $(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)"))