]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
imagebuilder: exclude metadata for profiles that have no kernel
authorEric Fahlgren <ericfahlgren@gmail.com>
Thu, 8 May 2025 22:28:52 +0000 (15:28 -0700)
committerRobert Marko <robimarko@gmail.com>
Sat, 24 May 2025 19:51:39 +0000 (21:51 +0200)
Device profiles that specify 'DEFAULT := n' are being included
in the imagebuilder metadata, specifically in .profiles.mk, even
though there is no kernel built for the device.  This results in
'make info' showing the device as valid, but then 'make image
PROFILE=xxx' failing with 'No rule to make target xxx-kernel.bin ...'

We exclude these profiles from the imagebuilder, avoiding these
errors.

Fixes: https://github.com/openwrt/openwrt/issues/18410
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18748
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit b88f3ebb3341281fa7e61dc4f039062e72c86b9e)

scripts/target-metadata.pl

index e1d4ef242b865d8351ae3ad2d159a4e1eefded96..55ac72c6da09f7c83252e9f9b9926ec547eb4306 100755 (executable)
@@ -433,7 +433,7 @@ sub gen_profile_mk() {
        my @targets = parse_target_metadata($file);
        foreach my $cur (@targets) {
                next unless $cur->{id} eq $target;
-               my @profile_ids_unique =  do { my %seen; grep { !$seen{$_}++} map { $_->{id} } @{$cur->{profiles}}};
+               my @profile_ids_unique =  do { my %seen; grep { !$seen{$_}++} map { $_->{id} } grep { $_->{default} !~ /^n/ } @{$cur->{profiles}}};
                print "PROFILE_NAMES = ".join(" ", @profile_ids_unique)."\n";
                foreach my $profile (@{$cur->{profiles}}) {
                        print $profile->{id}.'_NAME:='.$profile->{name}."\n";