Ian Wienand b08d522be7 Build jammy packages
This is an import of the infrastructure to make Jammy packages

Depends-On: https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/840788
Change-Id: Ie66d3b1e39ef9fa714b1dabdb7eb61cc43538587
2022-05-06 12:53:24 +10:00

25 lines
560 B
Perl
Executable File

#!/usr/bin/perl
#
# Extract the kernel version from the kernel version header file. Takes the
# kernel source path as its only argument. If the version header couldn't be
# found, print nothing and exit quietly.
my $ksrc = shift;
unless ($ksrc && open (VERSION, "$ksrc/include/linux/version.h")) {
exit 0;
}
my $found;
my $line = <VERSION>;
if ($line =~ /"(.+)"/) {
print "$1\n";
$found = 1;
}
exit 0 if $found;
unless (open (VERSION, "$ksrc/include/config/kernel.release")) {
exit 0;
}
if ($line = <VERSION>) {
print "$line";
}
exit 0;