Used to mix device profiles (specified in the image makefile) with
regular target profiles.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
define ProfileDefault
NAME:=
define ProfileDefault
NAME:=
dumpinfo : $(call shexport,Profile/$(1)/Description)
DUMPINFO += \
echo "Target-Profile: $(1)"; \
dumpinfo : $(call shexport,Profile/$(1)/Description)
DUMPINFO += \
echo "Target-Profile: $(1)"; \
+ $(if $(PRIORITY), echo "Target-Profile-Priority: $(PRIORITY)"; ) \
echo "Target-Profile-Name: $(NAME)"; \
echo "Target-Profile-Packages: $(PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES) $(PACKAGES))"; \
if [ -f ./config/profile-$(1) ]; then \
echo "Target-Profile-Name: $(NAME)"; \
echo "Target-Profile-Packages: $(PACKAGES) $(call extra_packages,$(DEFAULT_PACKAGES) $(PACKAGES))"; \
if [ -f ./config/profile-$(1) ]; then \
foreach my $target (@target) {
my $profiles = $target->{profiles};
foreach my $target (@target) {
my $profiles = $target->{profiles};
+ $target->{sort} and @$profiles = sort {
+ $a->{priority} <=> $b->{priority} or
+ $a->{name} cmp $b->{name};
+ } @$profiles;
foreach my $profile (@$profiles) {
print <<EOF;
foreach my $profile (@$profiles) {
print <<EOF;
$profile = {
id => $1,
name => $1,
$profile = {
id => $1,
name => $1,
packages => []
};
push @{$target->{profiles}}, $profile;
};
packages => []
};
push @{$target->{profiles}}, $profile;
};
- /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1;
+ /^Target-Profile-Name:\s*(.+)\s*$/ and do {
+ $target->{sort} = 1;
+ $profile->{name} = $1;
+ };
+ /^Target-Profile-Priority:\s*(\d+)\s*$/ and $profile->{priority} = $1;
/^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ];
/^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE);
/^Target-Profile-Config:/ and $profile->{config} = get_multiline(*FILE, "\t");
/^Target-Profile-Packages:\s*(.*)\s*$/ and $profile->{packages} = [ split(/\s+/, $1) ];
/^Target-Profile-Description:\s*(.*)\s*/ and $profile->{desc} = get_multiline(*FILE);
/^Target-Profile-Config:/ and $profile->{config} = get_multiline(*FILE, "\t");