IB: include SUPPORTED_DEVICES in 'make info' output
authorDaniel Golle <daniel@makrotopia.org>
Mon, 11 Mar 2019 04:32:29 +0000 (05:32 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 11 Mar 2019 04:32:29 +0000 (05:32 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include/image.mk
scripts/metadata.pm
scripts/target-metadata.pl
target/imagebuilder/files/Makefile

index 62e3af9e4f6bbccef1f1c4f1386b0c0f3d7e3549..9e40a54f51c6f41db9c49207207adb86b4b5ab10 100644 (file)
@@ -558,6 +558,7 @@ Target-Profile: DEVICE_$(1)
 Target-Profile-Name: $(DEVICE_TITLE)
 Target-Profile-Packages: $(DEVICE_PACKAGES)
 Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0)
+Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES)
 Target-Profile-Description:
 $(DEVICE_DESCRIPTION)
 @@
index d9804f8dc382953c08c66518133a530d8968e7b6..a338b8caadbcb0fd8d99686260a3eb2a82e531f3 100644 (file)
@@ -140,6 +140,7 @@ sub parse_target_metadata($) {
                                id => $1,
                                name => $1,
                                has_image_metadata => 0,
+                               supported_devices => [],
                                priority => 999,
                                packages => []
                        };
@@ -148,6 +149,7 @@ sub parse_target_metadata($) {
                };
                /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
                /^Target-Profile-hasImageMetadata:\s*(\d+)\s*$/ and $profile->{has_image_metadata} = $1;
+               /^Target-Profile-SupportedDevices:\s*(.+)\s*$/ and $profile->{supported_devices} = [ split(/\s+/, $1) ];
                /^Target-Profile-Priority:\s*(\d+)\s*$/ and do {
                        $profile->{priority} = $1;
                        $target->{sort} = 1;
index 2f045eb3798d67ab0badf8f93d56633d661dbc43..4e4bc73d9183905a7fcf3f4604efba9754848e1e 100755 (executable)
@@ -423,6 +423,9 @@ sub gen_profile_mk() {
                foreach my $profile (@{$cur->{profiles}}) {
                        print $profile->{id}.'_NAME:='.$profile->{name}."\n";
                        print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n";
+                       if (@{$profile->{supported_devices}} > 0) {
+                               print $profile->{id}.'_SUPPORTED_DEVICES:='.join(' ', @{$profile->{supported_devices}})."\n";
+                       }
                        print $profile->{id}.'_PACKAGES:='.join(' ', @{$profile->{packages}})."\n";
                }
        }
index 6e8d1eaf29cfd2f654fd6f119ae85befa0faf478..547289b97103e19564decc792e26db3e9b675a08 100644 (file)
@@ -73,8 +73,9 @@ include $(INCLUDE_DIR)/target.mk
 
 USER_PROFILE ?= $(firstword $(PROFILE_NAMES))
 PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \
-       echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo '    $(subst ','"'"',$($(p)_NAME))'; ) echo '    Packages: $($(p)_PACKAGES)'; echo '    hasImageMetadata: $($(p)_HAS_IMAGE_METADATA)';\
-)
+       echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo '    $(subst ','"'"',$($(p)_NAME))'; ) \
+       echo '    Packages: $($(p)_PACKAGES)'; echo '    hasImageMetadata: $($(p)_HAS_IMAGE_METADATA)'; \
+       [ "$($(p)_SUPPORTED_DEVICES)" ] && echo '    SupportedDevices: $($(p)_SUPPORTED_DEVICES)'; )
 
 .profiles.mk: .targetinfo
        @$(SCRIPT_DIR)/target-metadata.pl profile_mk $< '$(BOARD)$(if $(SUBTARGET),/$(SUBTARGET))' > $@