Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: dump-target-info print kernel versions #4743

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 23 additions & 3 deletions scripts/dump-target-info.pl
Expand Up @@ -4,7 +4,7 @@
use warnings;
use Cwd;

my (%targets, %architectures);
my (%targets, %architectures, %kernels);

$ENV{'TOPDIR'} = Cwd::getcwd();

Expand All @@ -13,7 +13,7 @@ sub parse_targetinfo {
my ($target_dir, $subtarget) = @_;

if (open M, "make -C '$target_dir' --no-print-directory DUMP=1 TARGET_BUILD=1 SUBTARGET='$subtarget' |") {
my ($target_name, $target_arch, @target_features);
my ($target_name, $target_arch, $target_kernel, $target_testing_kernel, @target_features);
while (defined(my $line = readline M)) {
chomp $line;

Expand All @@ -23,19 +23,32 @@ sub parse_targetinfo {
elsif ($line =~ /^Target-Arch-Packages: (.+)$/) {
$target_arch = $1;
}
elsif ($line =~ /^Linux-Version: (\d\.\d+)\.\d+$/) {
$target_kernel = $1;
}
elsif ($line =~ /^Linux-Testing-Version: (\d\.\d+)\.\d+$/) {
$target_testing_kernel = $1;
}
elsif ($line =~ /^Target-Features: (.+)$/) {
@target_features = split /\s+/, $1;
}
elsif ($line =~ /^@\@$/) {
if ($target_name && $target_arch &&
if ($target_name && $target_arch && $target_kernel &&
!grep { $_ eq 'broken' or $_ eq 'source-only' } @target_features) {
$targets{$target_name} = $target_arch;
$architectures{$target_arch} ||= [];
push @{$architectures{$target_arch}}, $target_name;
$kernels{$target_name} ||= [];
push @{$kernels{$target_name}}, $target_kernel;
if ($target_testing_kernel) {
push @{$kernels{$target_name}}, $target_testing_kernel;
}
}

undef $target_name;
undef $target_arch;
undef $target_kernel;
undef $target_testing_kernel;
@target_features = ();
}
}
Expand Down Expand Up @@ -85,7 +98,14 @@ sub get_targetinfo {
printf "%s %s\n", $target_arch, join ' ', @{$architectures{$target_arch}};
}
}
elsif (@ARGV == 1 && $ARGV[0] eq 'kernels') {
get_targetinfo();
foreach my $target_name (sort keys %targets) {
printf "%s %s\n", $target_name, join ' ', @{$kernels{$target_name}};
}
}
else {
print "Usage: $0 targets\n";
print "Usage: $0 architectures\n";
print "Usage: $0 kernels\n";
}