Skip to content
Permalink
Browse files

ib: display whether profile comes with image metadata

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>
  • Loading branch information...
dangowrt committed Mar 6, 2019
1 parent c877825 commit 13c379e5c6e37b3822bf6e4e18cc6317e5b40fbb
Showing with 5 additions and 1 deletion.
  1. +1 −0 include/image.mk
  2. +2 −0 scripts/metadata.pm
  3. +1 −0 scripts/target-metadata.pl
  4. +1 −1 target/imagebuilder/files/Makefile
@@ -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)
@@
@@ -139,13 +139,15 @@ sub parse_target_metadata($) {
$profile = {
id => $1,
name => $1,
has_image_metadata => 0,
priority => 999,
packages => []
};
$1 =~ /^DEVICE_/ and $target->{has_devices} = 1;
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;
@@ -422,6 +422,7 @@ ()
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";
}
}
@@ -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

0 comments on commit 13c379e

Please sign in to comment.
You can’t perform that action at this time.