diff options
Diffstat (limited to 'debian/patches')
4 files changed, 97 insertions, 0 deletions
diff --git a/debian/patches/1001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch b/debian/patches/1001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch new file mode 100644 index 0000000..40242ac --- /dev/null +++ b/debian/patches/1001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch @@ -0,0 +1,55 @@ +From 0e69615135244378ade7063ea6da76c7d68474ba Mon Sep 17 00:00:00 2001 +From: Andreas Beckmann <anbe@debian.org> +Date: Wed, 19 Apr 2023 17:37:54 +0200 +Subject: [PATCH] do not perform rpm queries on Debian/Ubuntu/Arch based + distributions + +Closes #329 +--- + dkms.in | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/dkms.in b/dkms.in +index 55eced3..5abb8eb 100644 +--- a/dkms.in ++++ b/dkms.in +@@ -296,6 +296,11 @@ setup_kernels_arches() + kernelver[0]=$(uname -r) + fi + if [[ ! $arch ]]; then ++ case "$running_distribution" in ++ debian* | ubuntu* | arch*) ++ arch[0]=$(uname -m) ++ ;; ++ *) + kernelver_rpm=$(rpm -qf "$install_tree/$kernelver" 2>/dev/null | \ + grep -v "not owned by any package" | grep kernel | head -n 1) + if ! arch[0]=$(rpm -q --queryformat "%{ARCH}" "$kernelver_rpm" 2>/dev/null); then +@@ -304,6 +309,8 @@ setup_kernels_arches() + arch[0]="ia32e" + fi + fi ++ ;; ++ esac + fi + if [[ ! $arch ]]; then + die 12 $"Could not determine architecture." +@@ -1579,7 +1586,15 @@ do_uninstall() + while [[ ${dir_to_remove} != ${dir_to_remove#/} ]]; do + dir_to_remove="${dir_to_remove#/}" + done ++ ++ case "$running_distribution" in ++ debian* | ubuntu* | arch*) ++ (if cd "$install_tree/$1"; then rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true) ++ ;; ++ *) + (if cd "$install_tree/$1"; then rpm -qf "${dir_to_remove}" >/dev/null 2>&1 || rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true) ++ ;; ++ esac + else + echo $" - Module was not found within $install_tree/$1/" + fi +-- +2.20.1 + diff --git a/debian/patches/only-autobuild-AUTOINSTALL-yes-modules.patch b/debian/patches/only-autobuild-AUTOINSTALL-yes-modules.patch new file mode 100644 index 0000000..0b000dd --- /dev/null +++ b/debian/patches/only-autobuild-AUTOINSTALL-yes-modules.patch @@ -0,0 +1,16 @@ +--- a/dkms_common.postinst.in ++++ b/dkms_common.postinst.in +@@ -160,6 +160,13 @@ if [ -z "$autoinstall" ]; then + exit 0 + fi + ++dkms_conf="/var/lib/dkms/$NAME/$VERSION/source/dkms.conf" ++autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL') ++if [ -z "$autoinstall" ]; then ++ echo "Not building the $NAME module which does not have AUTOINSTALL enabled." ++ exit 0 ++fi ++ + # On 1st installation, let us look for a directory + # in @MODDIR@ which matches $(uname -r). If none + # is found it is possible that buildd is being used diff --git a/debian/patches/rebuild-modules-on-header-upgrade.patch b/debian/patches/rebuild-modules-on-header-upgrade.patch new file mode 100644 index 0000000..437bd23 --- /dev/null +++ b/debian/patches/rebuild-modules-on-header-upgrade.patch @@ -0,0 +1,22 @@ +--- a/kernel_postinst.d_dkms.in ++++ b/kernel_postinst.d_dkms.in +@@ -34,6 +34,19 @@ case "${uname_s}" in + ;; + esac + ++case $0 in *header_postinst.d*) ++ # unbuild all autoinstalled modules for this kernel to ensure they get ++ # rebuilt against the updated headers by the next autoinstall below ++ for mod_ver in $(dkms status -k "$inst_kern" 2>/dev/null | grep ': installed' | cut -d, -f1 | sort -u) ++ do ++ dkms_conf="/var/lib/dkms/$mod_ver/source/dkms.conf" ++ autoinstall=$(bash -c 'AUTOINSTALL=; . "'"$dkms_conf"'" >/dev/null 2>&1; echo $AUTOINSTALL') ++ test -n "$autoinstall" || continue ++ dkms unbuild -k "$inst_kern" "$mod_ver" ++ done ++ ;; ++esac ++ + if [ -x @LIBDIR@/dkms_autoinstaller ]; then + exec @LIBDIR@/dkms_autoinstaller start "$inst_kern" + fi diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..21e13c0 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,4 @@ + +1001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch +rebuild-modules-on-header-upgrade.patch +only-autobuild-AUTOINSTALL-yes-modules.patch |