Package: release.debian.org Severity: normal Tags: bullseye User: release.debian....@packages.debian.org Usertags: pu
Hi, dkms-autopkgtest is currently a no-op in bullseye since it does not take care of installing kernel headers. Therefore I'd like to backport the dkms-autopkgtest script from sid to bullseye. Additional changes are fixes for Lintian errors and providing a virtual dh-dkms package which will simplify using *-dkms packages from bookworm in bullseye. I've tested the changes running autopkgtests in bullseye for my nvidia driver pu requests. There should only be a low potential for regressions since not many packages use "Testsuite: autopkgtest-pkg-dkms" in bullseye. Andreas
diff --git a/debian/changelog b/debian/changelog index dfa7594..7635368 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +dkms (2.8.4-4+deb11u1) bullseye; urgency=medium + + * Backport dkms-autopkgtest changes from sid. + - If no linux-headers-* packages are installed, install all available ones + (matching the version of installed linux-doc) before building modules. + * Update Lintian overrides. + * Provide versioned virtual package dh-dkms. + * Add myself to Uploaders. + * Upload to bullseye. + + -- Andreas Beckmann <a...@debian.org> Fri, 09 Dec 2022 02:38:21 +0100 + +dkms (2.8.4-4) unstable; urgency=medium + + * debian/patches/149.patch: + - upstream proposed patch to fix wrong bash interpreter (Closes: #986674) + + -- Gianfranco Costamagna <locutusofb...@debian.org> Fri, 09 Apr 2021 14:28:48 +0200 + dkms (2.8.4-3) unstable; urgency=medium [ Gianfranco Costamagna ] diff --git a/debian/control b/debian/control index e2a8b91..01cf9f5 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,8 @@ Maintainer: Dynamic Kernel Modules Support Team <d...@packages.debian.org> Uploaders: David Paleino <da...@debian.org>, Petter Reinholdtsen <p...@debian.org>, Aron Xu <a...@debian.org>, - Mario Limonciello <mario_limoncie...@dell.com> + Mario Limonciello <mario_limoncie...@dell.com>, + Andreas Beckmann <a...@debian.org>, Build-Depends: debhelper-compat (= 13) Standards-Version: 4.5.0 Homepage: https://github.com/dell-oss/dkms @@ -15,7 +16,6 @@ Rules-Requires-Root: no Package: dkms Architecture: all -Provides: dh-sequence-dkms Multi-Arch: foreign Pre-Depends: lsb-release Depends: ${misc:Depends}, @@ -31,6 +31,9 @@ Recommends: fakeroot, linux-headers-686-pae | linux-headers-amd64 | linux-headers-generic | linux-headers, Suggests: menu, e2fsprogs Breaks: ${dkms:Breaks} +Provides: + dh-sequence-dkms, + dh-dkms (= ${binary:Version}), Description: Dynamic Kernel Module Support Framework DKMS is a framework designed to allow individual kernel modules to be upgraded without changing the whole kernel. It is also very easy to rebuild modules as diff --git a/debian/copyright b/debian/copyright index 6845425..3b6223a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -13,6 +13,7 @@ Copyright: © 2008-2009, David Paleino <d.pale...@gmail.com> © 2008-2009, Mario Limonciello <mario_limoncie...@dell.com> © 2008-2009, Giuseppe Iuculano <giuse...@iuculano.it> © 2019-2020, Gianfranco Costamagna <locutusofb...@debian.org> + © 2020-2022, Andreas Beckmann <a...@debian.org> License: GPL-2+ Files: debian/HOWTO.Debian diff --git a/debian/dkms.lintian-overrides b/debian/dkms.lintian-overrides index 2b2bd84..c0ad75f 100644 --- a/debian/dkms.lintian-overrides +++ b/debian/dkms.lintian-overrides @@ -1 +1,5 @@ -dkms binary: python-script-but-no-python-dep usr/share/apport/package-hooks/dkms_packages.py #!/usr/bin/python3 +# dependency is provided by apport +python3-script-but-no-python3-dep /usr/bin/python3 (does not satisfy python3:any | python3-minimal:any) [usr/share/apport/package-hooks/dkms_packages.py] + +# this location is used by multiple external scripts to find dkms bits +executable-in-usr-lib diff --git a/debian/patches/149.patch b/debian/patches/149.patch new file mode 100644 index 0000000..16f5bd9 --- /dev/null +++ b/debian/patches/149.patch @@ -0,0 +1,28 @@ +## Description: add some description +## Origin/Author: add some origin or author +## Bug: bug URL +From e6ee197dcedd7b77acc434c1def9fbbb1fd3f302 Mon Sep 17 00:00:00 2001 +From: Gianfranco Costamagna <costamagnagianfra...@yahoo.it> +Date: Fri, 9 Apr 2021 14:28:34 +0200 +Subject: [PATCH] Update kernel_install.d_dkms to remove wrong bash path + +See: +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=986674 + +Lintian emits + +E: dkms: wrong-path-for-interpreter etc/dkms/kernel_install.d_dkms (#!/usr/bin/bash != /bin/bash) +--- + kernel_install.d_dkms | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel_install.d_dkms b/kernel_install.d_dkms +index c1d6df1..f1b3b38 100755 +--- a/kernel_install.d_dkms ++++ b/kernel_install.d_dkms +@@ -1,4 +1,4 @@ +-#!/usr/bin/bash ++#!/bin/bash + + if [[ "$1" == "add" ]]; then + /etc/kernel/postinst.d/dkms $2 diff --git a/debian/patches/series b/debian/patches/series index aa7de72..a15b701 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ do-not-load-modules.patch export-CC.patch +149.patch diff --git a/debian/scripts/dkms-autopkgtest b/debian/scripts/dkms-autopkgtest index 1ca054a..f40d640 100755 --- a/debian/scripts/dkms-autopkgtest +++ b/debian/scripts/dkms-autopkgtest @@ -5,31 +5,86 @@ set -eu result=0 +summary= +crlf=" +" + +header_packages= +check_for_linux_headers() { + # Act only on the first run. + if [ -n "$header_packages" ]; then + return + fi + + # Which Linux header packages are installed? + header_packages=$(dpkg-query -f '${Status} ${Package}\n' -W 'linux-headers-*' 2>/dev/null | sed -r -n 's/^install ok installed //p') + if [ -n "$header_packages" ]; then + echo "I: Using the following Linux header packages that were already installed:" + for p in $header_packages ; do + echo "I: $p" + done + return + fi + + # Which Linux header packages could be installed? + # linux-doc is a dependency generated by autodep8 for autopkgtest-pkg-dkms + # install only linux-headers-* matching the source version of linux-doc + wanted_source_version=$(dpkg-query -f '${source:Version}' -W linux-doc 2>/dev/null || true) + candidates=$(apt-cache search --names-only '^linux-headers-' | awk '{print $1}' | grep -v -E -e '-common(-rt)?$') + echo "I: No Linux header packages are installed." + echo "I: Installing all available ones from src:linux $wanted_source_version:" + for p in $candidates ; do + if [ -z "$wanted_source_version" ]; then + echo "I: $p" + header_packages="$header_packages $p" + continue + fi + source_versions=$(apt-cache show $p | perl -ne 'if (/^$/) { print $s || $v, "\n"; $s=$v=""; } $s=$1 if /^Source: .* \((.*)\)$/; $v=$1 if /^Version: (.*)$/;') + for sv in $source_versions ; do + if [ "$sv" = "$wanted_source_version" ]; then + echo "I: install $p" + header_packages="$header_packages $p" + continue 2 + fi + done + echo "I: skip $p" + done + RC=0 + apt-get install --no-install-recommends -yq $header_packages </dev/null 2>&1 || RC=$? + if [ "$RC" -ne 0 ]; then + echo "E: Linux headers failed to install." >&2 + exit 1 + fi +} run_pkg() { pkg="$1" - echo "I: Removing binary package $pkg, to get clean state" + echo "I: Removing binary package $pkg, to get clean state." export DEBIAN_FRONTEND=noninteractive apt-get purge -yq $pkg </dev/null 2>&1 >/dev/null || true echo "I: Installing binary package $pkg" export DEBIAN_FRONTEND=noninteractive RC=0 - apt-get install -yq $pkg </dev/null 2>&1 || RC=$? + apt-get install --no-install-recommends -yq $pkg </dev/null 2>&1 || RC=$? if [ "$RC" -ne 0 ]; then - echo "E: Package $pkg failed to install" >&2 - exit 1 + echo "E: Package $pkg failed to install." >&2 + result=1 + return fi # Try and remove dkms to spot packages which miss a dkms dependency + echo "I: Checking for missing dkms dependency by trying to deinstall dkms" dpkg --remove dkms || true if ! dkms_conf=$(dpkg -L $pkg | grep '/usr/src' | grep '/dkms.conf$'); then - echo "I: Package $pkg has no dkms.conf, skipping" + echo "I: Package $pkg has no dkms.conf, skipping." return fi + check_for_linux_headers + echo "I: Testing binary package $pkg" dkms_pkg=$(bash -c ". $dkms_conf > /dev/null; echo \$PACKAGE_NAME" 2>/dev/null) @@ -41,14 +96,32 @@ run_pkg() { kver="${k%/build}" kver="${kver#/lib/modules/}" + # If any linux-meta is in triggers, only test abistems that + # match triggers otherwise continue. This helps integration + # with adt-matrix which specifically requests test results + # against each individual linux-meta and tracks unique results + # per kernel abi. + abistem=$(echo $kver | sed 's/-[a-z]*$//') + case "${ADT_TEST_TRIGGERS-}" in + *linux-meta*) + case "$ADT_TEST_TRIGGERS" in + *"$abistem"*) + ;; + *) + continue + ;; + esac + esac + echo "I: Trying to build $dkms_pkg/$dkms_ver for $kver" res=0 dkms build -m "$dkms_pkg" -v "$dkms_ver" -k "$kver" || res=$? if [ "$res" = 9 ]; then - echo "I: $dkms_pkg/$dkms_ver is not supported on $kver (BUILD_EXCLUSIVE directive), skipping" + echo "I: $dkms_pkg/$dkms_ver is not supported on $kver (BUILD_EXCLUSIVE directive), skipping." + summary="${summary}I: SKIP $kver${crlf}" continue - fi + fi if [ "$res" != 0 ]; then echo "E: $dkms_pkg/$dkms_ver failed to build for $kver" >&2 @@ -56,31 +129,41 @@ run_pkg() { echo "========== $makelog ==========" >&2 cat "$makelog" >&2 || true echo "====================" >&2 + summary="${summary}I: FAIL $kver${crlf}" result=1 continue fi if ! dkms install -m "$dkms_pkg" -v "$dkms_ver" -k "$kver" ; then echo "E: $dkms_pkg/$dkms_ver failed to install for $kver" >&2 + summary="${summary}I: FAIL $kver${crlf}" result=1 continue fi - echo "I: Testing if $dkms_pkg modules are correctly installed" + echo "I: Testing if $dkms_pkg modules are correctly installed." dkmsstatus="$(dkms status $dkms_pkg -k $kver)" echo "$dkmsstatus" if [ -z "$dkmsstatus" ]; then echo "E: dkms status output is empty!" >&2 + summary="${summary}I: FAIL $kver${crlf}" result=1 continue fi - if ! echo "$dkmsstatus" | grep -q "installed$"; then + # This should check for exact zfs module against exact kernel + # abi to allow testing multiple kernels simultaniously. Some + # dkms modules are pre-built inside the kernel (i.e. zfs on + # Ubuntu) thus we should accept such result. + if ! echo "$dkmsstatus" | sed 's/ (WARNING! Diff between built and installed module!)//g' | grep -q "installed$"; then echo "E: not installed" >&2 + summary="${summary}I: FAIL $kver${crlf}" result=1 continue fi + summary="${summary}I: PASS $kver${crlf}" + done # collect build logs as artifacts @@ -116,4 +199,11 @@ for pkg in $(grep-dctrl -FDepends -e '(^| )dkms' -o -FPackage -e '\-dkms' debian run_pkg $pkg done +if [ -n "$summary" ]; then + echo "I: Summary:" + echo -n "$summary" +fi + exit $result + +# vim: sw=4:ts=4:et