summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2022-07-15 19:08:05 +0000
committerBen Hutchings <benh@debian.org>2022-07-15 19:08:05 +0000
commit0f3a87917ec07f33880219bcec940036d759b338 (patch)
tree07a42c0f0b807e531223f24e58c55916c7d9e20c /debian
parent6f292f9946a3b76c05a31efdd9019539db326cf0 (diff)
parent9b3412db75b5509fe9f26084aea961c32df2a220 (diff)
downloadlinux-debian-0f3a87917ec07f33880219bcec940036d759b338.tar.gz
Merge branch 'ci-kbuild' into 'sid'
Add test case for linux-kbuild and fix a missing script there See merge request kernel-team/linux!509
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/bin/gencontrol.py14
-rw-r--r--debian/changelog3
-rw-r--r--debian/rules.d/scripts/Makefile1
-rw-r--r--debian/templates/tests-control.headers.in3
-rw-r--r--debian/templates/tests-control.main.in2
-rw-r--r--debian/tests/kbuild47
6 files changed, 69 insertions, 1 deletions
diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py
index 0233b01f2..d1dbad26c 100755
--- a/debian/bin/gencontrol.py
+++ b/debian/bin/gencontrol.py
@@ -103,6 +103,7 @@ class Gencontrol(Base):
self.tests_control = self.process_packages(
self.templates['tests-control.main'], vars)
self.tests_control_image = None
+ self.tests_control_headers = None
self.installer_packages = {}
@@ -568,6 +569,19 @@ class Gencontrol(Base):
self.tests_control_image = tests_control
self.tests_control.append(tests_control)
+ if flavour == self.quick_flavour:
+ tests_control = self.process_package(
+ self.templates['tests-control.headers'][0], vars)
+ tests_control['Depends'].append(
+ PackageRelationGroup(package_headers['Package'],
+ override_arches=(arch,)))
+ if self.tests_control_headers:
+ self.tests_control_headers['Depends'].extend(
+ tests_control['Depends'])
+ else:
+ self.tests_control_headers = tests_control
+ self.tests_control.append(tests_control)
+
def get_config(*entry_name):
entry_real = ('image',) + entry_name
entry = self.config.get(entry_real, None)
diff --git a/debian/changelog b/debian/changelog
index b2010b2be..950f82cb9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -299,6 +299,9 @@ linux (5.18.8-1) UNRELEASED; urgency=medium
* d/salsa-ci.yml: Sync build-script with upstream
* d/salsa-ci.yml: Handle APT sources in debian.sources as well as
sources.list
+ * d/tests: Remove obsolete dependencies of python test
+ * d/tests: Add kbuild test that builds a trivial OOT module
+ * linux-kbuild: Add missing pahole-version.sh script
[ Vincent Blut ]
* [armhf] drivers/crypto/caam: Enable CRYPTO_DEV_FSL_CAAM as module
diff --git a/debian/rules.d/scripts/Makefile b/debian/rules.d/scripts/Makefile
index 64892cbf4..a8e011972 100644
--- a/debian/rules.d/scripts/Makefile
+++ b/debian/rules.d/scripts/Makefile
@@ -29,6 +29,7 @@ SCRIPTS = \
modules-check.sh \
namespace.pl \
pahole-flags.sh \
+ pahole-version.sh \
patch-kernel \
recordmcount.pl \
setlocalversion \
diff --git a/debian/templates/tests-control.headers.in b/debian/templates/tests-control.headers.in
new file mode 100644
index 000000000..92a64f859
--- /dev/null
+++ b/debian/templates/tests-control.headers.in
@@ -0,0 +1,3 @@
+Tests: kbuild
+Depends:
+Restrictions: superficial
diff --git a/debian/templates/tests-control.main.in b/debian/templates/tests-control.main.in
index f63e7805d..0b2e2daf0 100644
--- a/debian/templates/tests-control.main.in
+++ b/debian/templates/tests-control.main.in
@@ -1,3 +1,3 @@
Tests: python
-Depends: python3, pycodestyle, pyflakes3
+Depends: python3
Restrictions: superficial
diff --git a/debian/tests/kbuild b/debian/tests/kbuild
new file mode 100644
index 000000000..b6797e397
--- /dev/null
+++ b/debian/tests/kbuild
@@ -0,0 +1,47 @@
+#!/bin/sh -eu
+
+mkdir "$AUTOPKGTEST_TMP"/foo
+cat >"$AUTOPKGTEST_TMP"/foo/foo.c <<EOF
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+static int __init foo_init(void)
+{
+ pr_info("foo initialised\n");
+ return 0;
+}
+module_init(foo_init);
+
+static void __exit foo_exit(void)
+{
+}
+module_exit(foo_exit);
+
+MODULE_LICENSE("GPL");
+EOF
+cat >"$AUTOPKGTEST_TMP"/foo/Kbuild <<EOF
+obj-m += foo.o
+EOF
+
+arch="$(dpkg --print-architecture)"
+release="$(debian/bin/getconfig.py version abiname)-$(debian/bin/getconfig.py base $arch none quick-flavour)"
+
+echo "I: Build for $release"
+# There are some warnings sent to stderr that we need to suppress,
+# but any other output to stderr should be treated as a failure.
+# We also want all stdout/stderr to appear in order in the log.
+# First, duplicate stdout to fd 3
+exec 3>&1
+# Next, run the build with stdout sent to the original stdout and
+# stderr sent through tee to both the original stdout and a file
+make -C /lib/modules/"$release"/build M="$AUTOPKGTEST_TMP"/foo V=1 \
+ 2>&1 1>&3 | tee "$AUTOPKGTEST_TMP"/foo/make.stderr
+# Close fd 3
+exec 3>&-
+# Check for any stderr output that doesn't match the suppressions
+if grep -q -v -E 'Skipping BTF generation .* due to unavailability of vmlinux' "$AUTOPKGTEST_TMP"/foo/make.stderr; then
+ echo >&2 "E: Unexpected warning/error messages"
+fi
+
+echo "I: Clean"
+make -C /lib/modules/"$release"/build M="$AUTOPKGTEST_TMP"/foo V=1 clean