ib: display whether profile comes with image metadata
authorDaniel Golle <daniel@makrotopia.org>
Wed, 6 Mar 2019 13:45:15 +0000 (14:45 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Wed, 6 Mar 2019 13:50:42 +0000 (14:50 +0100)
Having image metadata (and signature) appended is a condition for
semi-automated sysupgrade, hence IB needs to be able to tell which
images will end up with metadata.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include/image.mk
scripts/metadata.pm
scripts/target-metadata.pl
target/imagebuilder/files/Makefile

index 5268f0bdb7850508dcfa88a39dd54fba4fc28209..62e3af9e4f6bbccef1f1c4f1386b0c0f3d7e3549 100644 (file)
@@ -557,6 +557,7 @@ define Device/DumpInfo
 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-Description:
 $(DEVICE_DESCRIPTION)
 @@
index 5300e293e7bf9cdf737fc630f4b68fea9cf045e2..d9804f8dc382953c08c66518133a530d8968e7b6 100644 (file)
@@ -139,6 +139,7 @@ sub parse_target_metadata($) {
                        $profile = {
                                id => $1,
                                name => $1,
+                               has_image_metadata => 0,
                                priority => 999,
                                packages => []
                        };
@@ -146,6 +147,7 @@ sub parse_target_metadata($) {
                        push @{$target->{profiles}}, $profile;
                };
                /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+               /^Target-Profile-hasImageMetadata:\s*(\d+)\s*$/ and $profile->{has_image_metadata} = $1;
                /^Target-Profile-Priority:\s*(\d+)\s*$/ and do {
                        $profile->{priority} = $1;
                        $target->{sort} = 1;
index ef0a34eb4ffae2fe9b8b50d6b4295600eee6f2f3..2f045eb3798d67ab0badf8f93d56633d661dbc43 100755 (executable)
@@ -422,6 +422,7 @@ sub gen_profile_mk() {
                print "PROFILE_NAMES = ".join(" ", map { $_->{id} } @{$cur->{profiles}})."\n";
                foreach my $profile (@{$cur->{profiles}}) {
                        print $profile->{id}.'_NAME:='.$profile->{name}."\n";
+                       print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n";
                        print $profile->{id}.'_PACKAGES:='.join(' ', @{$profile->{packages}})."\n";
                }
        }
index 76ea19028ed9b2a4b06d96f01bc2d29b69495958..1370ec27dfe15b77ff4fcda1d158834906548691 100644 (file)
@@ -73,7 +73,7 @@ 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 '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo '    $(subst ','"'"',$($(p)_NAME))'; ) echo '    Packages: $($(p)_PACKAGES)'; echo '    hasImageMetadata: $($(p)_HAS_IMAGE_METADATA)';\
 )
 
 .profiles.mk: .targetinfo