Remove ABI and firmware checking scripts

This change removes the ABI and firmware checking scripts from the
repository since they are currently not being used in the pipeline.
This commit is contained in:
Fabian Mastenbroek 2021-03-15 18:29:38 +01:00
parent 04c4556be2
commit 1d84103cd8
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
11 changed files with 1 additions and 27747 deletions

View file

@ -3,8 +3,6 @@ KERNEL_MAJ=5
KERNEL_MIN=9
KERNEL_PATCHLEVEL=16
# increment KREL if the ABI changes (abicheck target in debian/rules)
# rebuild packages with new KREL and run 'make abiupdate'
KREL=1
PKGREL=1
@ -45,8 +43,6 @@ endif
GITVERSION:=$(shell git rev-parse HEAD)
SKIPABI=0
BUILD_DIR=build
KERNEL_SRC=ubuntu-mainline
@ -89,9 +85,6 @@ ${DST_DEB}: ${BUILD_DIR}.prepared
cd ${BUILD_DIR}; dpkg-buildpackage --jobs=auto -b -uc -us
${BUILD_DIR}.prepared: $(addsuffix .prepared,${KERNEL_SRC} ${MODULES} debian)
cp -a fwlist-previous ${BUILD_DIR}/
cp -a abi-prev-* ${BUILD_DIR}/
cp -a abi-blacklist ${BUILD_DIR}/
touch $@
debian.prepared: debian
@ -136,25 +129,6 @@ ${ZFSDIR}.prepared: ${ZFSONLINUX_SUBMODULE}
rm -rf ${BUILD_DIR}/${MODULES}/tmp
touch ${ZFSDIR}.prepared
# call after ABI bump with header deb in working directory
.PHONY: abiupdate
abiupdate: abi-prev-${KVNAME}
abi-prev-${KVNAME}: abi-tmp-${KVNAME}
ifneq ($(strip $(shell git status --untracked-files=no --porcelain -z)),)
@echo "working directory unclean, aborting!"
@false
else
git rm "abi-prev-*"
mv $< $@
git add $@
git commit -s -m "update ABI file for ${KVNAME}" -m "(generated with debian/scripts/abi-generate)"
@echo "update abi-prev-${KVNAME} committed!"
endif
abi-tmp-${KVNAME}:
@ test -e ${HDR_DEB} || (echo "need ${HDR_DEB} to extract ABI data!" && false)
debian/scripts/abi-generate ${HDR_DEB} $@ ${KVNAME} 1
.PHONY: clean
clean:
rm -rf *~ build *.prepared ${KERNEL_CFG_ORG}

View file

File diff suppressed because it is too large Load diff

25
debian/rules vendored
View file

@ -104,7 +104,7 @@ install: .install_mark .tools_install_mark .headers_install_mark .usr_headers_in
dh_fixperms
binary: install
debian/rules fwcheck abicheck
debian/rules
dh_strip -N${PVE_HEADER_PKG} -N${PVE_USR_HEADER_PKG}
dh_makeshlibs
dh_shlibdeps
@ -253,27 +253,4 @@ ${MODULES}/zfs.ko: .compile_mark
cp ${MODULES}/${ZFSDIR}/module/spl/spl.ko ${MODULES}/
cp ${MODULES}/${ZFSDIR}/module/zstd/zzstd.ko ${MODULES}/
fwlist-${KVNAME}: .compile_mark .modules_compile_mark
debian/scripts/find-firmware.pl debian/${PVE_KERNEL_PKG}/lib/modules/${KVNAME} >fwlist.tmp
mv fwlist.tmp $@
.PHONY: fwcheck
fwcheck: fwlist-${KVNAME} fwlist-previous
@echo "checking fwlist for changes since last built firmware package.."
@echo "if this check fails, add fwlist-${KVNAME} to the pve-firmware repository and upload a new firmware package together with the ${KVNAME} kernel"
sort fwlist-previous | uniq > fwlist-previous.sorted
sort fwlist-${KVNAME} | uniq > fwlist-${KVNAME}.sorted
-diff -up -N fwlist-previous.sorted fwlist-${KVNAME}.sorted > fwlist.diff
@test -s fwlist.diff \
&& echo "done, no need to rebuild pve-firmware" \
|| echo "Please rebuild pve-firmware"
abi-${KVNAME}: .compile_mark
debian/scripts/abi-generate debian/${PVE_HEADER_PKG}/usr/src/linux-headers-${KVNAME}/Module.symvers abi-${KVNAME} ${KVNAME}
.PHONY: abicheck
abicheck: debian/scripts/abi-check abi-${KVNAME} abi-prev-* abi-blacklist
debian/scripts/abi-check abi-${KVNAME} abi-prev-* ${SKIPABI}
.PHONY: clean

View file

@ -1,215 +0,0 @@
#!/usr/bin/perl -w
my $abinew = shift;
my $abiold = shift;
my $skipabi = shift;
# to catch multiple abi-prev-* files being passed in
die "invalid value for skipabi parameter\n"
if (defined($skipabi) && $skipabi !~ /^[01]$/);
$abinew =~ /abi-(.*)/;
my $abistr = $1;
$abiold =~ /abi-prev-(.*)/;
my $prev_abistr = $1;
my $fail_exit = 1;
my $EE = "EE:";
my $errors = 0;
my $abiskip = 0;
my $count;
print "II: Checking ABI...\n";
if ($skipabi) {
print "WW: Explicitly asked to ignore ABI, running in no-fail mode\n";
$fail_exit = 0;
$abiskip = 1;
$EE = "WW:";
}
if ($prev_abistr ne $abistr) {
print "II: Different ABI's, running in no-fail mode\n";
$fail_exit = 0;
$EE = "WW:";
}
if (not -f "$abinew" or not -f "$abiold") {
print "EE: Previous or current ABI file missing!\n";
print " $abinew\n" if not -f "$abinew";
print " $abiold\n" if not -f "$abiold";
# Exit if the ABI files are missing, but return status based on whether
# skip ABI was indicated.
if ("$abiskip" eq "1") {
exit(0);
} else {
exit(1);
}
}
my %symbols;
my %symbols_ignore;
my %modules_ignore;
my %module_syms;
# See if we have any ignores
my $ignore = 0;
print " Reading symbols/modules to ignore...";
for $file ("abi-blacklist") {
if (-f $file) {
open(IGNORE, "< $file") or
die "Could not open $file";
while (<IGNORE>) {
chomp;
if ($_ =~ m/M: (.*)/) {
$modules_ignore{$1} = 1;
} else {
$symbols_ignore{$_} = 1;
}
$ignore++;
}
close(IGNORE);
}
}
print "read $ignore symbols/modules.\n";
sub is_ignored($$) {
my ($mod, $sym) = @_;
die "Missing module name in is_ignored()" if not defined($mod);
die "Missing symbol name in is_ignored()" if not defined($sym);
if (defined($symbols_ignore{$sym}) or defined($modules_ignore{$mod})) {
return 1;
}
return 0;
}
# Read new syms first
print " Reading new symbols ($abistr)...";
$count = 0;
open(NEW, "< $abinew") or
die "Could not open $abinew";
while (<NEW>) {
chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
$symbols{$4}{'type'} = $1;
$symbols{$4}{'loc'} = $2;
$symbols{$4}{'hash'} = $3;
$module_syms{$2} = 0;
$count++;
}
close(NEW);
print "read $count symbols.\n";
# Now the old symbols, checking for missing ones
print " Reading old symbols...";
$count = 0;
open(OLD, "< $abiold") or
die "Could not open $abiold";
while (<OLD>) {
chomp;
m/^(\S+)\s(.+)\s(0x[0-9a-f]+)\s(.+)$/;
$symbols{$4}{'old_type'} = $1;
$symbols{$4}{'old_loc'} = $2;
$symbols{$4}{'old_hash'} = $3;
$count++;
}
close(OLD);
print "read $count symbols.\n";
print "II: Checking for missing symbols in new ABI...";
$count = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'type'})) {
print "\n" if not $count;
printf(" MISS : %s%s\n", $sym,
is_ignored($symbols{$sym}{'old_loc'}, $sym) ? " (ignored)" : "");
$count++ if !is_ignored($symbols{$sym}{'old_loc'}, $sym);
}
}
print " " if $count;
print "found $count missing symbols\n";
if ($count) {
print "$EE Symbols gone missing (what did you do!?!)\n";
$errors++;
}
print "II: Checking for new symbols in new ABI...";
$count = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'old_type'})) {
print "\n" if not $count;
print " NEW : $sym\n";
$count++;
}
}
print " " if $count;
print "found $count new symbols\n";
if ($count) {
print "WW: Found new symbols. Not recommended unless ABI was bumped\n";
}
print "II: Checking for changes to ABI...\n";
$count = 0;
my $moved = 0;
my $changed_type = 0;
my $changed_hash = 0;
foreach $sym (keys(%symbols)) {
if (!defined($symbols{$sym}{'old_type'}) or
!defined($symbols{$sym}{'type'})) {
next;
}
# Changes in location don't hurt us, but log it anyway
if ($symbols{$sym}{'loc'} ne $symbols{$sym}{'old_loc'}) {
printf(" MOVE : %-40s : %s => %s\n", $sym, $symbols{$sym}{'old_loc'},
$symbols{$sym}{'loc'});
$moved++;
}
# Changes to export type are only bad if new type isn't
# EXPORT_SYMBOL. Changing things to GPL are bad.
if ($symbols{$sym}{'type'} ne $symbols{$sym}{'old_type'}) {
printf(" TYPE : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_type'}.
$symbols{$sym}{'type'}, is_ignored($symbols{$sym}{'loc'}, $sym)
? " (ignored)" : "");
$changed_type++ if $symbols{$sym}{'type'} ne "EXPORT_SYMBOL"
and !is_ignored($symbols{$sym}{'loc'}, $sym);
}
# Changes to the hash are always bad
if ($symbols{$sym}{'hash'} ne $symbols{$sym}{'old_hash'}) {
printf(" HASH : %-40s : %s => %s%s\n", $sym, $symbols{$sym}{'old_hash'},
$symbols{$sym}{'hash'}, is_ignored($symbols{$sym}{'loc'}, $sym)
? " (ignored)" : "");
$changed_hash++ if !is_ignored($symbols{$sym}{'loc'}, $sym);
$module_syms{$symbols{$sym}{'loc'}}++;
}
}
print "WW: $moved symbols changed location\n" if $moved;
print "$EE $changed_type symbols changed export type and weren't ignored\n" if $changed_type;
print "$EE $changed_hash symbols changed hash and weren't ignored\n" if $changed_hash;
$errors++ if $changed_hash or $changed_type;
if ($changed_hash) {
print "II: Module hash change summary...\n";
foreach $mod (sort { $module_syms{$b} <=> $module_syms{$a} } keys %module_syms) {
next if ! $module_syms{$mod};
printf(" %-40s: %d\n", $mod, $module_syms{$mod});
}
}
print "II: Done\n";
if ($errors) {
exit($fail_exit);
} else {
exit(0);
}

View file

@ -1,42 +0,0 @@
#!/usr/bin/perl -w
use PVE::Tools;
use IO::File;
sub usage {
die "USAGE: $0 INFILE OUTFILE [ABI INFILE-IS-DEB]\n";
}
my $input_file = shift // usage();
my $output_file = shift // usage();
my $abi = shift;
my $extract_deb = shift;
die "input file '$input_file' does not exist\n" if ! -e $input_file;
my $modules_symver_fh;
if ($extract_deb) {
usage() if !defined($abi);
my $cmd = [];
push @$cmd, ['dpkg', '--fsys-tarfile', $input_file];
push @$cmd, ['tar', '-xOf', '-', "./usr/src/linux-headers-${abi}/Module.symvers"];
$modules_symver_fh = IO::File->new_tmpfile();
PVE::Tools::run_command($cmd, output => '>&'.fileno($modules_symver_fh));
seek($modules_symver_fh, 0, 0);
} else {
open($modules_symver_fh, '<', $input_file) or die "can't open '$input_file' - $!\n";
}
my $lines = [];
while(my $line = <$modules_symver_fh>) {
if ($line =~ /^(.+)\s+(.+)\s+(.+)$/) {
push @$lines, "$3 $2 $1";
} else {
warn "malformed symvers line: '$line'\n";
}
}
close($modules_symver_fh);
PVE::Tools::file_set_contents($output_file, join("\n", sort @$lines));

View file

@ -1,35 +0,0 @@
#!/bin/bash
set -e
top=$(pwd)
if [ "$#" -ne 3 ]; then
echo "USAGE: $0 repo patchdir ref"
echo "\t exports patches from 'repo' to 'patchdir' based on 'ref'"
exit 1
fi
# parameters
kernel_submodule=$1
kernel_patchdir=$2
base_ref=$3
cd "${kernel_submodule}"
echo "clearing old exported patchqueue"
rm -f "${top}/${kernel_patchdir}"/*.patch
echo "exporting patchqueue using 'git format-patch [...] ${base_ref}.."
git format-patch \
--quiet \
--no-numbered \
--no-cover-letter \
--zero-commit \
--no-signature \
--diff-algorithm=myers \
--output-dir \
"${top}/${kernel_patchdir}" \
"${base_ref}.."
git checkout ${base_ref}
cd "${top}"

View file

@ -1,32 +0,0 @@
#!/usr/bin/perl -w
use strict;
my $dir = shift;
die "no directory to scan" if !$dir;
die "no such directory" if ! -d $dir;
# die "strange directory name: $dir" if $dir !~ m|^(.*/)?(5.\d.\d+\-\d+\-pve)(/+)?$|;
my $apiver = $2;
open(TMP, "find '$dir' -name '*.ko'|");
while (defined(my $fn = <TMP>)) {
chomp $fn;
my $relfn = $fn;
$relfn =~ s|^$dir/*||;
my $cmd = "/sbin/modinfo -F firmware '$fn'";
open(MOD, "$cmd|");
while (defined(my $fw = <MOD>)) {
chomp $fw;
print "$fw $relfn\n";
}
close(MOD);
}
close TMP;
exit 0;

View file

@ -1,29 +0,0 @@
#!/bin/bash
set -e
top=$(pwd)
if [[ "$#" -lt 2 || "$#" -gt 3 ]]; then
echo "USAGE: $0 repo patchdir [branch]"
echo "\t imports patches from 'patchdir' into patchqueue branch 'branch' in 'repo'"
exit 1
fi
# parameters
kernel_submodule=$1
kernel_patchdir=$2
if [[ -z "$3" ]]; then
pq_branch='pq'
else
pq_branch=$3
fi
cd "${kernel_submodule}"
echo "creating patchqeueue branch '${pq_branch}'"
git checkout -b "${pq_branch}"
echo "importing patches from '${kernel_patchdir}'"
git am "${top}/${kernel_patchdir}"/*.patch
cd "${top}"

View file

@ -1,119 +0,0 @@
#!/bin/bash
set -e
top=$(pwd)
# parameters
kernel_submodule=
kernel_patchdir=
new_tag=
rebase=
# generated based on new_tag
pq_branch=
# previously checked out in submodule
old_ref=
function cleanup_pq_branch {
if [[ -n $pq_branch ]]; then
echo "cleaning up PQ branch '$pq_branch'"
cd "${top}/${kernel_submodule}"
git checkout --quiet $old_ref
git reset --hard
git branch -D "$pq_branch"
fi
}
function error_exit {
echo "$1"
set +e
cleanup_pq_branch
cd "${top}"
exit 1
}
if [[ "$#" -lt 3 || "$#" -gt 4 ]]; then
echo "USAGE: $0 submodule patchdir tag [rebase]"
echo "\t fetches and checks out 'tag' in 'submodule'"
echo "\t if 'rebase' is given, imports, rebases and exports patchqueue from 'patchdir' as well"
exit 1
fi
kernel_submodule=$1
if [ ! -d "${kernel_submodule}" ]; then
error_exit "'${kernel_submodule}' must be a directory!"
fi
kernel_patchdir=$2
if [ ! -d "${kernel_patchdir}" ]; then
error_exit "'${kernel_patchdir}' must be a directory!"
fi
new_tag=$3
rebase=$4
if [[ -n $(git status --untracked-files=no --porcelain) ]]; then
error_exit "working directory unclean, aborting"
fi
cd "${kernel_submodule}"
## check for tag and fetch if needed
echo "checking for tag '${new_tag}'"
if [[ -z $(git tag -l "${new_tag}") ]]; then
echo "tag not found, fetching and retrying"
git fetch --tags
fi
if [[ -z $(git tag -l "${new_tag}") ]]; then
error_exit "tag not found, aborting"
fi
echo "tag found"
cd "${top}"
if [[ -n "$rebase" ]]; then
echo ""
echo "automatic patchqueue rebase enabled"
cd "${kernel_submodule}"
## preparing patch queue branch
old_ref=$(git rev-parse HEAD)
pq_branch="auto_pq/${new_tag}"
cd "${top}"
echo "previous HEAD: ${old_ref}"
echo ""
"${top}/debian/scripts/import-patchqueue" "${kernel_submodule}" "${kernel_patchdir}" "${pq_branch}" || error_exit "failed to import patchqueue"
cd "${kernel_submodule}"
## rebase patches
echo ""
echo "rebasing patchqueue on top of '${new_tag}'"
git rebase "${new_tag}"
cd "${top}"
## regenerate exported patch queue
echo ""
"${top}/debian/scripts/export-patchqueue" "${kernel_submodule}" "${kernel_patchdir}" "${new_tag}" || error_exit "failed to export patchqueue"
cleanup_pq_branch
cd "${top}"
pq_branch=
fi
cd "${kernel_submodule}"
echo ""
echo "checking out '${new_tag}' in submodule"
git checkout --quiet "${new_tag}"
cd "${top}"
echo ""
echo "committing results"
git commit --verbose -s -m "update sources to ${new_tag}" -m "(generated with debian/scripts/import-upstream-tag)" "${kernel_submodule}"
if [[ -n "$rebase" ]]; then
git add "${kernel_patchdir}"
git commit --verbose -s -m "rebase patches on top of ${new_tag}" -m "(generated with debian/scripts/import-upstream-tag)" "${kernel_patchdir}"
fi

File diff suppressed because it is too large Load diff