From ba7efc155e6ee47de57cc745cfa0ad56b941bf03 Mon Sep 17 00:00:00 2001 From: shaoyang Date: Fri, 7 Nov 2025 14:40:08 +0800 Subject: [PATCH 1/2] Revert "uos: fix bug when dkms status exist (original_module exists)" This reverts commit 3336b5cbc4f82db57408fe034a8c0264b99d34be. --- debian/changelog | 6 ------ kernel_prerm.d_dkms | 6 +----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3be6e56..da9dd22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -dkms (3.1.0-2) unstable; urgency=medium - - * fix bug when dkms status, (original_module exists) - - -- shaoyang Thu, 06 Nov 2025 14:47:59 +0800 - dkms (3.1.0-1) unstable; urgency=medium * New upstream release. diff --git a/kernel_prerm.d_dkms b/kernel_prerm.d_dkms index 4ccc353..aeb8e3a 100755 --- a/kernel_prerm.d_dkms +++ b/kernel_prerm.d_dkms @@ -4,11 +4,7 @@ inst_kern=$1 if command -v dkms > /dev/null; then - dkms status -k "$inst_kern" 2>/dev/null | while IFS= read -r line; do - name=$(echo "$line" | cut -d'/' -f1) - vers=$(echo "$line" | cut -d'/' -f2 | cut -d',' -f1) - arch=$(echo "$line" | awk -F', ' '{print $3}' | cut -d':' -f1) - status=$(echo "$line" | awk -F': ' '{print $2}' | awk '{print $1}') + dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do [ "$status" = "installed" ] || continue echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch" From 200d6e2b6e4189a6d527a3bbb81934d1999859bb Mon Sep 17 00:00:00 2001 From: shaoyang Date: Fri, 7 Nov 2025 15:13:58 +0800 Subject: [PATCH 2/2] fix bug when dkms status (original_module exists) Signed-off-by: shaoyang --- debian/changelog | 6 +++ ...n-dkms-status-original_module-exists.patch | 52 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 59 insertions(+) create mode 100644 debian/patches/2002-fix-bug-when-dkms-status-original_module-exists.patch diff --git a/debian/changelog b/debian/changelog index da9dd22..e55b247 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dkms (3.1.0-2) unstable; urgency=medium + + * fix bug when dkms status (original_module exists) + + -- shaoyang Fri, 07 Nov 2025 15:11:30 +0800 + dkms (3.1.0-1) unstable; urgency=medium * New upstream release. diff --git a/debian/patches/2002-fix-bug-when-dkms-status-original_module-exists.patch b/debian/patches/2002-fix-bug-when-dkms-status-original_module-exists.patch new file mode 100644 index 0000000..d7e5072 --- /dev/null +++ b/debian/patches/2002-fix-bug-when-dkms-status-original_module-exists.patch @@ -0,0 +1,52 @@ +From 3d1eb96107b3c8a6e9fd42c3b27c729d1d62fe19 Mon Sep 17 00:00:00 2001 +From: shaoyang +Date: Fri, 7 Nov 2025 15:04:38 +0800 +Subject: [PATCH] fix bug when dkms status, (original_module exists) + +Signed-off-by: shaoyang +--- + kernel_prerm.d_dkms | 6 +++++- + kernel_prerm.d_dkms.in | 10 +++++++--- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/kernel_prerm.d_dkms b/kernel_prerm.d_dkms +index aeb8e3a..4ccc353 100755 +--- a/kernel_prerm.d_dkms ++++ b/kernel_prerm.d_dkms +@@ -4,7 +4,11 @@ + inst_kern=$1 + + if command -v dkms > /dev/null; then +- dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do ++ dkms status -k "$inst_kern" 2>/dev/null | while IFS= read -r line; do ++ name=$(echo "$line" | cut -d'/' -f1) ++ vers=$(echo "$line" | cut -d'/' -f2 | cut -d',' -f1) ++ arch=$(echo "$line" | awk -F', ' '{print $3}' | cut -d':' -f1) ++ status=$(echo "$line" | awk -F': ' '{print $2}' | awk '{print $1}') + [ "$status" = "installed" ] || continue + echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 + dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch" +diff --git a/kernel_prerm.d_dkms.in b/kernel_prerm.d_dkms.in +index cbf0c94..c30f2aa 100755 +--- a/kernel_prerm.d_dkms.in ++++ b/kernel_prerm.d_dkms.in +@@ -5,9 +5,13 @@ + inst_kern=$1 + + if command -v dkms > /dev/null; then +- dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do +- [ "$status" = "installed" ] || continue +- echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 ++ dkms status -k "$inst_kern" 2>/dev/null | while IFS= read -r line; do ++ name=$(echo "$line" | cut -d'/' -f1) ++ vers=$(echo "$line" | cut -d'/' -f2 | cut -d',' -f1) ++ arch=$(echo "$line" | awk -F', ' '{print $3}' | cut -d':' -f1) ++ status=$(echo "$line" | awk -F': ' '{print $2}' | awk '{print $1}') ++ [ "$status" = "installed" ] || continue ++ echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 + # Compromise on using 'unbuild' to remove the module when a + # kernel is being removed. The 'remove' command is too + # destructive. The 'uninstall' command leaves built files +-- +2.20.1 + diff --git a/debian/patches/series b/debian/patches/series index 86f8d8c..ffb8da6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,5 +6,6 @@ 1003-add-help-h-options.patch 1004-common.postinst-source-etc-dkms-framework.conf.d-.co.patch 2001-do-not-perform-rpm-queries-on-Debian-Ubuntu-Arch-bas.patch +2002-fix-bug-when-dkms-status-original_module-exists.patch rebuild-modules-on-header-upgrade.patch only-autobuild-AUTOINSTALL-yes-modules.patch