Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] dkms: update to 3.0.3 and update other related packages
@ 2022-05-15  7:57 subnut
  2022-05-15  8:24 ` [PR PATCH] [Updated] " subnut
                   ` (61 more replies)
  0 siblings, 62 replies; 63+ messages in thread
From: subnut @ 2022-05-15  7:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

There is a new pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9321 bytes --]

From 4e1cf3a29d6cdaadd81c7a1a5d591a337e8b4f58 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 11:50:41 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

The following dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 21 ---------------------
 srcpkgs/dkms/template                  | 19 ++++++++++++-------
 2 files changed, 12 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/dkms/files/kernel.d/dkms.prerm

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
deleted file mode 100644
index 155e9734aee2..000000000000
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# We're passed the version of the kernel being installed
-PKGNAME="$1"
-VERSION="$2"
-
-if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
-fi
-
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
-
-exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..35387b743c57 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,14 +21,19 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+	vsed -i kernel_prerm.d_dkms \
+		-e 's-/usr/sbin-/usr/bin-g; s/^inst_kern=.*$/inst_kern="$2"/'
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
+	vinstall kernel_prerm.d_dkms 754 etc/kernel.d/pre-remove 10-dkms
 	# Kernel hooks.
 	vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
-	vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
 }

From c2ea42dc1f147306e0c72cf5dd62a8f6e05724ba Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..f6ddd376f36b 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"
@@ -14,6 +14,7 @@ create_wrksrc=yes
 short_desc="Broadcom proprietary wireless drivers for Linux - DKMS kernel module"
 dkms_modules="wl ${version}"
 depends="dkms"
+triggers="dkms initramfs-regenerate"
 
 case "$XBPS_TARGET_MACHINE" in
 i686*)

From 72ef73234d0cfca1791bdd9557ed45c7da913eae Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From c7436c562edaca64cbafcb8c3e3d85b52713cff2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 18847aea906b056a9cbf4d3ad1ec538226196961 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.

old:
	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new:
	zfs/2.1.4, 5.15.39_1, x86_64: installed

So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 6 +++---
 srcpkgs/xbps-triggers/template   | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..b898117cdbc6 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -30,8 +30,8 @@ remove_modules() {
 			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
+			_kver=$(echo "$line"|awk '{print $2}'); _kver=${_kver%,}
+			_modver=$(echo "$line"|awk '{print $1}'); _modver=${_modver%,}; _modver=${_modver##*/}
 			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
 			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..df006fa906e2 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
 version=0.122
-revision=1
+revision=2
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
@ 2022-05-15  8:24 ` subnut
  2022-05-15  8:35 ` [PR REVIEW] " subnut
                   ` (60 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15  8:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9918 bytes --]

From 4e1cf3a29d6cdaadd81c7a1a5d591a337e8b4f58 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 11:50:41 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

The following dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 21 ---------------------
 srcpkgs/dkms/template                  | 19 ++++++++++++-------
 2 files changed, 12 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/dkms/files/kernel.d/dkms.prerm

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
deleted file mode 100644
index 155e9734aee2..000000000000
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# We're passed the version of the kernel being installed
-PKGNAME="$1"
-VERSION="$2"
-
-if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
-fi
-
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
-
-exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..35387b743c57 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,14 +21,19 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+	vsed -i kernel_prerm.d_dkms \
+		-e 's-/usr/sbin-/usr/bin-g; s/^inst_kern=.*$/inst_kern="$2"/'
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
+	vinstall kernel_prerm.d_dkms 754 etc/kernel.d/pre-remove 10-dkms
 	# Kernel hooks.
 	vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
-	vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
 }

From c2ea42dc1f147306e0c72cf5dd62a8f6e05724ba Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..f6ddd376f36b 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"
@@ -14,6 +14,7 @@ create_wrksrc=yes
 short_desc="Broadcom proprietary wireless drivers for Linux - DKMS kernel module"
 dkms_modules="wl ${version}"
 depends="dkms"
+triggers="dkms initramfs-regenerate"
 
 case "$XBPS_TARGET_MACHINE" in
 i686*)

From 72ef73234d0cfca1791bdd9557ed45c7da913eae Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From c7436c562edaca64cbafcb8c3e3d85b52713cff2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From ed13267941ae1d106bf1b3255a3f427cdaa494aa Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 26 ++++++++++++++++++--------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..029bb19ec3f2 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -30,14 +30,24 @@ remove_modules() {
 			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
-			if [ $? -eq 0 ]; then
-				echo "done."
+			_kver=$(echo "$line"|awk '{print $2}'); _kver=${_kver%,}
+			_modver=$(echo "$line"|awk '{print $1}'|sed 's#^.*/\(.*\).$#\1#;')
+			if [ "$_kver" = added ] && [ -d "/var/lib/dkms/${1}/${_modver}/build" ]; then
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				rm -rf "/var/lib/dkms/${1}/${_modver}/build"
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			else
-				echo "FAILED!"
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			fi
 		done
 		shift 2
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..df006fa906e2 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
 version=0.122
-revision=1
+revision=2
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
  2022-05-15  8:24 ` [PR PATCH] [Updated] " subnut
@ 2022-05-15  8:35 ` subnut
  2022-05-15  8:37 ` [PR PATCH] [Updated] " subnut
                   ` (59 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15  8:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
For a demo of this code
- Ensure you are on linux `5.15` or greater
- Install `ddcci-dkms-0.4.1` (from any commit before #37127 is merged)
  (During installation, you should see this message)
  ```
  ddcci-dkms-0.4.1_1: configuring ...
  DKMS module 'ddcci-0.4.1' already added, skipping.
  Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
  DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
  for errors in the log file.
  ```
- Run `xbps-remove ddcci-dkms`
  (You should see this line in the output)
  ```
  Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
  ``` 

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
  2022-05-15  8:24 ` [PR PATCH] [Updated] " subnut
  2022-05-15  8:35 ` [PR REVIEW] " subnut
@ 2022-05-15  8:37 ` subnut
  2022-05-15  9:07 ` [PR REVIEW] " subnut
                   ` (58 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15  8:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9912 bytes --]

From 4e1cf3a29d6cdaadd81c7a1a5d591a337e8b4f58 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 11:50:41 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

The following dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 21 ---------------------
 srcpkgs/dkms/template                  | 19 ++++++++++++-------
 2 files changed, 12 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/dkms/files/kernel.d/dkms.prerm

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
deleted file mode 100644
index 155e9734aee2..000000000000
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# We're passed the version of the kernel being installed
-PKGNAME="$1"
-VERSION="$2"
-
-if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
-fi
-
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
-
-exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..35387b743c57 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,14 +21,19 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+	vsed -i kernel_prerm.d_dkms \
+		-e 's-/usr/sbin-/usr/bin-g; s/^inst_kern=.*$/inst_kern="$2"/'
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
+	vinstall kernel_prerm.d_dkms 754 etc/kernel.d/pre-remove 10-dkms
 	# Kernel hooks.
 	vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
-	vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
 }

From c2ea42dc1f147306e0c72cf5dd62a8f6e05724ba Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..f6ddd376f36b 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"
@@ -14,6 +14,7 @@ create_wrksrc=yes
 short_desc="Broadcom proprietary wireless drivers for Linux - DKMS kernel module"
 dkms_modules="wl ${version}"
 depends="dkms"
+triggers="dkms initramfs-regenerate"
 
 case "$XBPS_TARGET_MACHINE" in
 i686*)

From 72ef73234d0cfca1791bdd9557ed45c7da913eae Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From c7436c562edaca64cbafcb8c3e3d85b52713cff2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 053cf8b6f451c506da8fe4ea7248d435cbea1d73 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 26 ++++++++++++++++++--------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..02812a4454f2 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -30,14 +30,24 @@ remove_modules() {
 			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
-			if [ $? -eq 0 ]; then
-				echo "done."
+			_kver=$(echo "$line"|awk '{print $2}'); _kver=${_kver%,}
+			_modver=$(echo "$line"|awk '{print $1}'|sed 's#^.*/\(.*\).$#\1#;')
+			if [ "$_kver" = added ] && [ -d "/var/lib/dkms/${1}/${_modver}/build" ]; then
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				rm -rf "/var/lib/dkms/${1}/${_modver}"
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			else
-				echo "FAILED!"
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			fi
 		done
 		shift 2
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..df006fa906e2 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,7 +1,7 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
 version=0.122
-revision=1
+revision=2
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"
 maintainer="Enno Boland <gottox@voidlinux.org>"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (2 preceding siblings ...)
  2022-05-15  8:37 ` [PR PATCH] [Updated] " subnut
@ 2022-05-15  9:07 ` subnut
  2022-05-15 11:37 ` subnut
                   ` (57 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15  9:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
For a demo of this code
- Ensure you are on linux `5.15` or greater
- Install `ddcci-dkms-0.4.1` (from any commit before #37127 is merged)
  (During installation, you should see this message)
  ```
  ddcci-dkms-0.4.1_1: configuring ...
  DKMS module 'ddcci-0.4.1' already added, skipping.
  Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
  DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
  for errors in the log file.
  ```
- Run `xbps-remove ddcci-dkms`

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (3 preceding siblings ...)
  2022-05-15  9:07 ` [PR REVIEW] " subnut
@ 2022-05-15 11:37 ` subnut
  2022-05-15 11:40 ` subnut
                   ` (56 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15 11:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
## For a demo of this code
- Ensure you are on linux `5.15` or greater
- Install `ddcci-dkms-0.4.1` (from any commit before #37127 is merged)
  (During installation, you should see this message)
  ```
  ddcci-dkms-0.4.1_1: configuring ...
  DKMS module 'ddcci-0.4.1' already added, skipping.
  Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
  DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
  for errors in the log file.
  ```
- Run `xbps-remove ddcci-dkms`

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (4 preceding siblings ...)
  2022-05-15 11:37 ` subnut
@ 2022-05-15 11:40 ` subnut
  2022-05-15 11:41 ` subnut
                   ` (55 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15 11:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
## For a demo of this code
<ol>
<li> Ensure you are on linux <code>5.15</code> or greater
<li> Install <code>ddcci-dkms-0.4.1</code>
<pre><code>ddcci-dkms-0.4.1_1: configuring ...
DKMS module 'ddcci-0.4.1' already added, skipping.
Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
for errors in the log file.</code></pre>
<li> Run <code>xbps-remove ddcci-dkms</code>
</ol>

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (5 preceding siblings ...)
  2022-05-15 11:40 ` subnut
@ 2022-05-15 11:41 ` subnut
  2022-05-15 11:41 ` subnut
                   ` (54 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
## For a demo of this code
<ol>
<li> Ensure you are on linux5.15 or greater
<li> Install ddcci-dkms-0.4.1
<pre><code>ddcci-dkms-0.4.1_1: configuring ...
DKMS module 'ddcci-0.4.1' already added, skipping.
Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
for errors in the log file.</code></pre>
<li> Run <code>xbps-remove ddcci-dkms</code>
</ol>

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (6 preceding siblings ...)
  2022-05-15 11:41 ` subnut
@ 2022-05-15 11:41 ` subnut
  2022-05-16  5:02 ` [PR PATCH] [Updated] " subnut
                   ` (53 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-15 11:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
## For a demo of this code
<ol>
<li> Ensure you are on linux 5.15 or greater
<li> Install ddcci-dkms-0.4.1
<pre><code>ddcci-dkms-0.4.1_1: configuring ...
DKMS module 'ddcci-0.4.1' already added, skipping.
Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
for errors in the log file.</code></pre>
<li> Run <code>xbps-remove ddcci-dkms</code>
</ol>

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (7 preceding siblings ...)
  2022-05-15 11:41 ` subnut
@ 2022-05-16  5:02 ` subnut
  2022-05-17 12:39 ` [PR REVIEW] " ahesford
                   ` (52 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-16  5:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10233 bytes --]

From 4e1cf3a29d6cdaadd81c7a1a5d591a337e8b4f58 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 11:50:41 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

The following dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 21 ---------------------
 srcpkgs/dkms/template                  | 19 ++++++++++++-------
 2 files changed, 12 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/dkms/files/kernel.d/dkms.prerm

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
deleted file mode 100644
index 155e9734aee2..000000000000
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# We're passed the version of the kernel being installed
-PKGNAME="$1"
-VERSION="$2"
-
-if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
-fi
-
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
-
-exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..35387b743c57 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,14 +21,19 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+	vsed -i kernel_prerm.d_dkms \
+		-e 's-/usr/sbin-/usr/bin-g; s/^inst_kern=.*$/inst_kern="$2"/'
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
+	vinstall kernel_prerm.d_dkms 754 etc/kernel.d/pre-remove 10-dkms
 	# Kernel hooks.
 	vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
-	vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
 }

From c2ea42dc1f147306e0c72cf5dd62a8f6e05724ba Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..f6ddd376f36b 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"
@@ -14,6 +14,7 @@ create_wrksrc=yes
 short_desc="Broadcom proprietary wireless drivers for Linux - DKMS kernel module"
 dkms_modules="wl ${version}"
 depends="dkms"
+triggers="dkms initramfs-regenerate"
 
 case "$XBPS_TARGET_MACHINE" in
 i686*)

From 72ef73234d0cfca1791bdd9557ed45c7da913eae Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From c7436c562edaca64cbafcb8c3e3d85b52713cff2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 91e9b4804e9be9e37c913e0f555a025dd6a6bb70 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 31 ++++++++++++++++++++-----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..b4ee34dd099e 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,23 +21,32 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
-			if [ $? -eq 0 ]; then
-				echo "done."
+			_modver=${_modver##*/}; _modver=${_modver%?}; _kver=${_kver%,}
+			if [ "$_kver" = added ] && [ -d "/var/lib/dkms/${1}/${_modver}/build" ]; then
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				rm -rf "/var/lib/dkms/${1}/${_modver}"
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			else
-				echo "FAILED!"
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			fi
 		done
 		shift 2
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (8 preceding siblings ...)
  2022-05-16  5:02 ` [PR PATCH] [Updated] " subnut
@ 2022-05-17 12:39 ` ahesford
  2022-05-17 12:39 ` ahesford
                   ` (51 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-17 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r874760351

Comment:
What problem does this fix?

`rm -rf "/var/lib/dkms/$VAR"` is pretty dangerous when the vars haven't been carefully sanitized. If there's ever a format change in the DKMS output, this could break horribly.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (10 preceding siblings ...)
  2022-05-17 12:39 ` ahesford
@ 2022-05-17 12:39 ` ahesford
  2022-05-18  2:48 ` subnut
                   ` (49 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-17 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r874748318

Comment:
Just keep the version we have in `$FILESDIR`. Our script is a bit more verbose (listing the kernel package name) and explicitly calling `/usr/bin/dkms` is better than calling `dkms` when the script verifies that the former exists but the latter is subject to `$PATH` shenanigans.

This will also make the script less likely to subtly break in a future update if there are unnoticed changes.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (9 preceding siblings ...)
  2022-05-17 12:39 ` [PR REVIEW] " ahesford
@ 2022-05-17 12:39 ` ahesford
  2022-05-17 12:39 ` ahesford
                   ` (50 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-17 12:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r874746193

Comment:
This is unnecessary. Almost no users will require that this driver be present in the initramfs, and those that do probably have custom setups to deal with the complexities of bringing up a wireless interface in an early-boot environment anyway. Better to let those users deal with manually updating their images than force every user of this driver to regenerate *all* initramfs images with an update.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (11 preceding siblings ...)
  2022-05-17 12:39 ` ahesford
@ 2022-05-18  2:48 ` subnut
  2022-05-18  2:48 ` [PR PATCH] [Updated] " subnut
                   ` (48 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  2:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875421348

Comment:
Removed.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (12 preceding siblings ...)
  2022-05-18  2:48 ` subnut
@ 2022-05-18  2:48 ` subnut
  2022-05-18  4:04 ` [PR REVIEW] " subnut
                   ` (47 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  2:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9986 bytes --]

From 4e1cf3a29d6cdaadd81c7a1a5d591a337e8b4f58 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 11:50:41 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

The following dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 21 ---------------------
 srcpkgs/dkms/template                  | 19 ++++++++++++-------
 2 files changed, 12 insertions(+), 28 deletions(-)
 delete mode 100644 srcpkgs/dkms/files/kernel.d/dkms.prerm

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
deleted file mode 100644
index 155e9734aee2..000000000000
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# We're passed the version of the kernel being installed
-PKGNAME="$1"
-VERSION="$2"
-
-if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
-fi
-
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
-
-exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..35387b743c57 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,14 +21,19 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+	vsed -i kernel_prerm.d_dkms \
+		-e 's-/usr/sbin-/usr/bin-g; s/^inst_kern=.*$/inst_kern="$2"/'
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
+	vinstall kernel_prerm.d_dkms 754 etc/kernel.d/pre-remove 10-dkms
 	# Kernel hooks.
 	vinstall ${FILESDIR}/kernel.d/dkms.postinst 754 etc/kernel.d/post-install 10-dkms
-	vinstall ${FILESDIR}/kernel.d/dkms.prerm 754 etc/kernel.d/pre-remove 10-dkms
 }

From 225b8794cf5e8eda8811790aa767266e73947929 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 3f64a46db66f03786a16e6dcf366038964850c9e Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From ab933322dcacad4a162799415232e4e4d21840a4 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 1042c29fa6845710645aab74f429bae76def5d43 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 31 ++++++++++++++++++++-----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..b4ee34dd099e 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,23 +21,32 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
-			if [ $? -eq 0 ]; then
-				echo "done."
+			_modver=${_modver##*/}; _modver=${_modver%?}; _kver=${_kver%,}
+			if [ "$_kver" = added ] && [ -d "/var/lib/dkms/${1}/${_modver}/build" ]; then
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				rm -rf "/var/lib/dkms/${1}/${_modver}"
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			else
-				echo "FAILED!"
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			fi
 		done
 		shift 2
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (13 preceding siblings ...)
  2022-05-18  2:48 ` [PR PATCH] [Updated] " subnut
@ 2022-05-18  4:04 ` subnut
  2022-05-18  4:04 ` [PR PATCH] [Updated] " subnut
                   ` (46 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  4:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 226 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875447907

Comment:
Done. I've also made our script a bit more efficient, and also POSIX-compatible.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (14 preceding siblings ...)
  2022-05-18  4:04 ` [PR REVIEW] " subnut
@ 2022-05-18  4:04 ` subnut
  2022-05-18  4:16 ` [PR REVIEW] " subnut
                   ` (45 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  4:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10237 bytes --]

From 1b16722c9f8e3681ce98f7b39abd2b595d7a4341 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 8ecbc71e689e7bd33c88fba69820adab19f62002 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 4548ce5f4a3d181e33648b3dfdfef20e0226910c Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From f598131b40f1b2a6c91f1c3c7d11b156857a708c Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From ed5f1dd49ebe5b6c3abc94eada4552c9e8eb4ab7 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:38:06 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 31 ++++++++++++++++++++-----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..b4ee34dd099e 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,23 +21,32 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
-			if [ $? -eq 0 ]; then
-				echo "done."
+			_modver=${_modver##*/}; _modver=${_modver%?}; _kver=${_kver%,}
+			if [ "$_kver" = added ] && [ -d "/var/lib/dkms/${1}/${_modver}/build" ]; then
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				rm -rf "/var/lib/dkms/${1}/${_modver}"
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			else
-				echo "FAILED!"
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+				if [ $? -eq 0 ]; then
+					echo "done."
+				else
+					echo "FAILED!"
+				fi
 			fi
 		done
 		shift 2
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (15 preceding siblings ...)
  2022-05-18  4:04 ` [PR PATCH] [Updated] " subnut
@ 2022-05-18  4:16 ` subnut
  2022-05-18  4:17 ` [PR PATCH] [Updated] " subnut
                   ` (44 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  4:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875452133

Comment:
> What problem does this fix?

See this - https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

> `rm -rf "/var/lib/dkms/$VAR"` is pretty dangerous

I agree.  

Also, after looking into what causes it, this looks like a `dkms` problem. So, I should probably leave it to them to fix this. Not our job.

_Removed._

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (16 preceding siblings ...)
  2022-05-18  4:16 ` [PR REVIEW] " subnut
@ 2022-05-18  4:17 ` subnut
  2022-05-18  4:18 ` subnut
                   ` (43 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  4:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1273 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9627 bytes --]

From 1b16722c9f8e3681ce98f7b39abd2b595d7a4341 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 8ecbc71e689e7bd33c88fba69820adab19f62002 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 4548ce5f4a3d181e33648b3dfdfef20e0226910c Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From f598131b40f1b2a6c91f1c3c7d11b156857a708c Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 4c7296ba29e1d7f0fd8e2c8facf0271942676143 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 11 +++++------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..e1f402090a96 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,17 +21,16 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
+			_modver=${_modver##*/}; _modver=${_modver%?}; _kver=${_kver%,}
 			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
 			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (17 preceding siblings ...)
  2022-05-18  4:17 ` [PR PATCH] [Updated] " subnut
@ 2022-05-18  4:18 ` subnut
  2022-05-18  5:04 ` subnut
                   ` (42 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  4:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9627 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 0dd65a087f954136176fe3e9cdcdbeee5da668ea Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: adapt to new `dkms status` format

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.
---
 srcpkgs/xbps-triggers/files/dkms | 11 +++++------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..e1f402090a96 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,17 +21,16 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
+			_modver=${_modver##*/}; _modver=${_modver%?}; _kver=${_kver%,}
 			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
 			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (18 preceding siblings ...)
  2022-05-18  4:18 ` subnut
@ 2022-05-18  5:04 ` subnut
  2022-05-18  5:05 ` [PR REVIEW] " subnut
                   ` (41 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  5:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10678 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 1ae09083324c841ec65c061d0f966006e829b569 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed.
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *any* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 27 +++++++++++++++++++--------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..7b65534dd0e4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,30 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+			_modver=${_modver##*/}
+			_kver=${_kver%,}
+			if [ "$_kver" = added ]; then
+				# The module wasn't built successfully for any kernel version, so it's status is 'added'
+				# The output must've been like this -
+				# 	module-lipsum/x.y.z: added
+				# Which caused _kver to be set to "added"
+				_modver=${_modver%:};
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				$DKMS remove -m "$1" -v "${_modver}" >/dev/null 2>&1
+			else
+				_modver=${_modver%,};
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+			fi
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (19 preceding siblings ...)
  2022-05-18  5:04 ` subnut
@ 2022-05-18  5:05 ` subnut
  2022-05-18  5:10 ` subnut
                   ` (40 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  5:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r873132092

Comment:
## For a demo of this code
<ol>
<li> Ensure you are on linux 5.15 or greater, and you don't have any linux kernel older than 5.15 installed
<li> Install ddcci-dkms-0.4.1
<pre><code>ddcci-dkms-0.4.1_1: configuring ...
DKMS module 'ddcci-0.4.1' already added, skipping.
Building DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
DKMS module 'ddcci-0.4.1' failed to build, please check /var/lib/dkms
for errors in the log file.</code></pre>
<li> Run <code>xbps-remove ddcci-dkms</code>
</ol>

### Without this
```
Removing DKMS module 'ddcci-0.4.1' for kernel-5.xx.yy_z... FAILED!
``` 

### With this
```
Cleaning up unbuilt DKMS module 'ddcci-0.4.1'... done.
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (20 preceding siblings ...)
  2022-05-18  5:05 ` [PR REVIEW] " subnut
@ 2022-05-18  5:10 ` subnut
  2022-05-18  5:14 ` [PR PATCH] [Updated] " subnut
                   ` (39 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  5:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875472805

Comment:
#### UPDATE:
Nope. This was an bug in the dkms trigger. But this bug existed since a long time ago. Not introduced by this PR.

I've fixed it in the latest commit, and also explained the bug in the commit message. 

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (21 preceding siblings ...)
  2022-05-18  5:10 ` subnut
@ 2022-05-18  5:14 ` subnut
  2022-05-18 12:40 ` [PR REVIEW] " ahesford
                   ` (38 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18  5:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10687 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 13c949bd4cc130889bf9f57dc337bdc3c28785ce Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 27 +++++++++++++++++++--------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..7b65534dd0e4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,30 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local _modver _kver _line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=' ' read _modver _kver _line; do
+			if echo "$_modver $_kver $_line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+			_modver=${_modver##*/}
+			_kver=${_kver%,}
+			if [ "$_kver" = added ]; then
+				# The module wasn't built successfully for any kernel version, so it's status is 'added'
+				# The output must've been like this -
+				# 	module-lipsum/x.y.z: added
+				# Which caused _kver to be set to "added"
+				_modver=${_modver%:};
+				echo -n "Cleaning up unbuilt DKMS module '${1}-${_modver}'... "
+				$DKMS remove -m "$1" -v "${_modver}" >/dev/null 2>&1
+			else
+				_modver=${_modver%,};
+				echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
+				$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+			fi
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (22 preceding siblings ...)
  2022-05-18  5:14 ` [PR PATCH] [Updated] " subnut
@ 2022-05-18 12:40 ` ahesford
  2022-05-18 12:40 ` ahesford
                   ` (37 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-18 12:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875838682

Comment:
This breaks version parsing for old versions of DKMS, which we can't do in case somebody does a partial system update. Suggest instead:
```sh
$DKMS status -m "$1" | while IFS="/, " read _modname _modver _line; do
	_modver="${_modver%:}"
	shift 2
```
which *should* reliably separate `$_modname` and `$_modver` in both old and new DKMS, leaving the rest of the line intact. Note that we still strip the possible `:` suffix in the version here.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (23 preceding siblings ...)
  2022-05-18 12:40 ` [PR REVIEW] " ahesford
@ 2022-05-18 12:40 ` ahesford
  2022-05-18 14:39 ` subnut
                   ` (36 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-18 12:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875842067

Comment:
```suggestion
			if [ "${_line}" = added ]; then
				# The module wasn't built successfully for any kernel version
				echo -n "Cleaning up DKMS module '${_modname}-${_modver}'... "
				$DKMS remove -m "${_modname}" -v "${_modver}" >/dev/null 2>&1
			else
				echo -n "Removing DKMS module '${_modname}-${_modver}' for kernel-${_kver}... "
				$DKMS remove -m "${_modname}" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
			fi
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (24 preceding siblings ...)
  2022-05-18 12:40 ` ahesford
@ 2022-05-18 14:39 ` subnut
  2022-05-18 14:54 ` subnut
                   ` (35 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 14:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r875984464

Comment:
> This breaks version parsing for old versions of DKMS, which we can't do in case somebody does a partial system update

Aaaah... good point. I'd never thought of that.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (25 preceding siblings ...)
  2022-05-18 14:39 ` subnut
@ 2022-05-18 14:54 ` subnut
  2022-05-18 14:54 ` subnut
                   ` (34 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 14:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r876003372

Comment:
Okay.

But what if `$1` and `$_modname` are different. Should we check for that? How should we handle that?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (26 preceding siblings ...)
  2022-05-18 14:54 ` subnut
@ 2022-05-18 14:54 ` subnut
  2022-05-18 15:18 ` ahesford
                   ` (33 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 14:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r876003372

Comment:
Okay.

But what if `$1` and `$_modname` are different? Should we check for that? How should we handle that?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (27 preceding siblings ...)
  2022-05-18 14:54 ` subnut
@ 2022-05-18 15:18 ` ahesford
  2022-05-18 15:30 ` [PR PATCH] [Updated] " subnut
                   ` (32 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-18 15:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r876032216

Comment:
The trigger already fails to verify that the module name reported by DKMS, so let's not worry about it. If you really think this could be an issue, verify that `"$1" = "${_modname}"` or skip the iteration.

My other suggestion had two bugs: 1. the shift shouldn't be applied because it is already done outside the loop (this is also a bug in the existing `shift 2; continue` line); 2. I'm not setting the kernel version properly. I think the proper solution is something more like

```sh
remove_modules() {
	local _modname _modver _kver _line _arch _status

	# Remove the specified modules from all kernels.
	set -- ${dkms_modules}
	while [ $# -gt 0 ]; do
		$DKMS status -m "$1" | while IFS="/, " read _modname _modver _line; do
			[ "$1" = "${_modname}" ] || continue

			_modver="${_modver%:}"

			if [ "${_line}" = added ]; then
				# The module wasn't built successfully for any kernel version
				echo -n "Cleaning up DKMS module '${_modname}-${_modver}'... "
				$DKMS remove -m "${_modname}" -v "${_modver}" >/dev/null 2>&1
				continue
			fi

			read _kver _arch _status <<-EOF
			${_line}
			EOF

			case "${_status}" in
				added|built|installed) ;;
				*) break ;;
			esac

			echo -n "Removing DKMS module '${_modname}-${_modver}' for kernel-${_kver}... "
			$DKMS remove -m "${_modname}" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
                done
                shift 2
        done
}


```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (28 preceding siblings ...)
  2022-05-18 15:18 ` ahesford
@ 2022-05-18 15:30 ` subnut
  2022-05-18 16:48 ` subnut
                   ` (31 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 15:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10442 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From b3c6393bf1300d44645280a4aa8ee6e7cbbc9a41 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 20 ++++++++++++--------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..c5145d8495cb 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,23 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver line
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
+		$DKMS status -m "$1" | while IFS=':/, ' read modname modver kver line; do
+			if echo "$modname $modver $kver $line" | grep -Evq '(added|built|installed)'; then
 				shift 2; continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
+			if [ "$kver" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			else
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			fi
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (29 preceding siblings ...)
  2022-05-18 15:30 ` [PR PATCH] [Updated] " subnut
@ 2022-05-18 16:48 ` subnut
  2022-05-18 17:36 ` subnut
                   ` (30 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10454 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 9364572984375dc26bb03bd99c5f2e9b252cef35 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 22 +++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..df3e766ce4bb 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,23 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while IFS=':/, ' read modname modver kver line; do
+			elif [ "$status" = installed ] || [ "$status" = built ]
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			if [ "$kver" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (30 preceding siblings ...)
  2022-05-18 16:48 ` subnut
@ 2022-05-18 17:36 ` subnut
  2022-05-18 17:37 ` subnut
                   ` (29 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 17:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10460 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 2b8aa65512902ffaeec6b3f6dd7f8b89e57d8680 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 22 +++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..bbaea51eb8f8 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,23 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while IFS=':/, ' read modname modver kver line; do
+			if [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			elif [ "$kver" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (31 preceding siblings ...)
  2022-05-18 17:36 ` subnut
@ 2022-05-18 17:37 ` subnut
  2022-05-21  1:51 ` [PR REVIEW] " ahesford
                   ` (28 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-18 17:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10467 bytes --]

From 68c085125de10c176f55a2aea23747bad05419a5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

Output of `dkms status` has changed, so I've rewritten the pre-remove
kernel hook, and also made it POSIX-compatible.

Also, note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 24 ++++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..32c7a79621a1 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,21 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ": installed" \
+        | while IFS=":/, " read name vers _ arch _
+        do
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 96f4a00e1c8dd9200a322074047ca936c43b3d06 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From a761c2ed3cb37d9919ab38905b7315dab75206f1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 8f4fd314965f1eb03f9f29ccf63d258cb036719d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 0f5aa337747b5858a5597bf9b000acf0f312bf41 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 22 +++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..f7e01b43ac6d 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,23 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while IFS=':/, ' read modname modver kver arch status; do
+			if [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			elif [ "$kver" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (33 preceding siblings ...)
  2022-05-21  1:51 ` [PR REVIEW] " ahesford
@ 2022-05-21  1:51 ` ahesford
  2022-05-21  4:08 ` [PR PATCH] [Updated] " subnut
                   ` (26 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-21  1:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r878619233

Comment:
`IFS=':/, '` makes the cut a bit more aggressive than my earlier proposal, but this is probably fine. The two-stage cut in my proposal restricted the more generic `IFS='/, '` cut to only two fields (module name and version), then applied the more specific `IFS=', '` cut to only the remainder. Is there any legitimate concern that any of the fields might have characters ':' or '/' that would foil this split?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (32 preceding siblings ...)
  2022-05-18 17:37 ` subnut
@ 2022-05-21  1:51 ` ahesford
  2022-05-21  1:51 ` ahesford
                   ` (27 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-21  1:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r878621496

Comment:
These two clauses should be flipped because `"$kver" = added` is more specific. Also, it might be worthwhile to verify that `$arch` and `$status` are empty, or the response isn't in the expected format.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (34 preceding siblings ...)
  2022-05-21  1:51 ` ahesford
@ 2022-05-21  4:08 ` subnut
  2022-05-21  4:09 ` [PR REVIEW] " subnut
                   ` (25 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-21  4:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 11072 bytes --]

From cf3a21f64a3ad99d1fbc2b1a6ee36c0b08024112 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

I've also rewritten the kernel pre-remove hook to make it compatible
with POSIX.1-2017.

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed

So, to make dkms.prerm compatible with both the older and newer outputs,
I have added this line -

	tr '/'	' '

This will split `zfs/2.1.4` into `zfs 2.1.4`, thereby making it
compatible with the older output (since we ignore the trailing commas).
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 27 ++++++++++++++------------
 srcpkgs/dkms/template                  | 15 ++++++++------
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..4613c83c6142 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,24 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ': installed' \
+        | sed 's/, / /g' \
+        | tr '/' ' '
+        | while read -r name vers kver arch
+        do
+            arch="${arch%:*}"
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 6be8b329e5da2bda5b8e7e526243b8cd73774ce8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From c27cee63a3da54fb7b964364c503d4f64c2d002d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 73c8d7b263c64d7807f5048511b28f07f6b3b187 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 472de9b3a6b7dec78133dca0cf1305eff2f25ccf Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 25 ++++++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..7427a3c27cf4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,26 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status _
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" \
+			| tr '/' ' ' \
+			| sed 's/[,:] / /g' \
+			| while read -r modname modver kver arch status _; do
+			if [ "$kver" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (35 preceding siblings ...)
  2022-05-21  4:08 ` [PR PATCH] [Updated] " subnut
@ 2022-05-21  4:09 ` subnut
  2022-05-21  4:16 ` [PR PATCH] [Updated] " subnut
                   ` (24 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-21  4:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r878640600

Comment:
Good point. I'd never thought if the `:` and `,` characters might appear in a module's name.

None of the fields can have the `/` character, as that would break dkms itself. I've verified that.

I'm more concerned about the `:` and `,` characters. They have the possibility to break this script.

I've pushed a fix in the latest commit.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (36 preceding siblings ...)
  2022-05-21  4:09 ` [PR REVIEW] " subnut
@ 2022-05-21  4:16 ` subnut
  2022-05-21  4:17 ` [PR REVIEW] " subnut
                   ` (23 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-21  4:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 11110 bytes --]

From cf3a21f64a3ad99d1fbc2b1a6ee36c0b08024112 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

I've also rewritten the kernel pre-remove hook to make it compatible
with POSIX.1-2017.

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed

So, to make dkms.prerm compatible with both the older and newer outputs,
I have added this line -

	tr '/'	' '

This will split `zfs/2.1.4` into `zfs 2.1.4`, thereby making it
compatible with the older output (since we ignore the trailing commas).
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 27 ++++++++++++++------------
 srcpkgs/dkms/template                  | 15 ++++++++------
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..4613c83c6142 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,24 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ': installed' \
+        | sed 's/, / /g' \
+        | tr '/' ' '
+        | while read -r name vers kver arch
+        do
+            arch="${arch%:*}"
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 6be8b329e5da2bda5b8e7e526243b8cd73774ce8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From c27cee63a3da54fb7b964364c503d4f64c2d002d Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 73c8d7b263c64d7807f5048511b28f07f6b3b187 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 48bf6bbf9feb0e6aee4ae9a5eadde96732a87e32 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 25 ++++++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..69121db88da4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,26 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status _
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" \
+			| tr '/' ' ' \
+			| sed 's/[,:] / /g' \
+			| while read -r modname modver kver arch status _; do
+			if [ "$kver" = added ] && [ -z "$status" ] && [ -z "$arch" ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (37 preceding siblings ...)
  2022-05-21  4:16 ` [PR PATCH] [Updated] " subnut
@ 2022-05-21  4:17 ` subnut
  2022-05-24  2:19 ` [PR PATCH] [Updated] " subnut
                   ` (22 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-21  4:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r878641311

Comment:
done.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (38 preceding siblings ...)
  2022-05-21  4:17 ` [PR REVIEW] " subnut
@ 2022-05-24  2:19 ` subnut
  2022-05-24  2:19 ` subnut
                   ` (21 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-24  2:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 11110 bytes --]

From e07bc2bfb9243f90e07608f6307be6f4a8bfe31e Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.3

I've also rewritten the kernel pre-remove hook to make it compatible
with POSIX.1-2017.

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed

So, to make dkms.prerm compatible with both the older and newer outputs,
I have added this line -

	tr '/'	' '

This will split `zfs/2.1.4` into `zfs 2.1.4`, thereby making it
compatible with the older output (since we ignore the trailing commas).
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 27 ++++++++++++++------------
 srcpkgs/dkms/template                  | 15 ++++++++------
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..4613c83c6142 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,24 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null \
+        | grep -F ': installed' \
+        | sed 's/, / /g' \
+        | tr '/' ' '
+        | while read -r name vers kver arch
+        do
+            arch="${arch%:*}"
+            echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+            /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+        done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..a3d3e48f1e77 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.3
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=89e57cf90298f020646a5fa61d11983406631486b9f5591bb9da9465ee969f3d
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 68d5c56994d12a7af09ef6f7d9687687f2c7bf53 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 6221f9c1be9df7f9f65ad498e99dc2810b6e30e5 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 0822ad69a1c63db2370dcd3275b482ab29602b28 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From e8d8d9cf9e6c0ff2ff87ed0a66148d91286dc3e8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 25 ++++++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..69121db88da4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,26 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status _
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" \
+			| tr '/' ' ' \
+			| sed 's/[,:] / /g' \
+			| while read -r modname modver kver arch status _; do
+			if [ "$kver" = added ] && [ -z "$status" ] && [ -z "$arch" ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (39 preceding siblings ...)
  2022-05-24  2:19 ` [PR PATCH] [Updated] " subnut
@ 2022-05-24  2:19 ` subnut
  2022-05-24  2:25 ` subnut
                   ` (20 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-24  2:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1135326700

Comment:
Rebased on `master`.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (40 preceding siblings ...)
  2022-05-24  2:19 ` subnut
@ 2022-05-24  2:25 ` subnut
  2022-05-24 13:34 ` ahesford
                   ` (19 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-05-24  2:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1135329246

Comment:
@ahesford Have you reviewed the updated logic? (I've now used `tr` to make the new output similar to the old one)

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (41 preceding siblings ...)
  2022-05-24  2:25 ` subnut
@ 2022-05-24 13:34 ` ahesford
  2022-06-22  7:04 ` [PR PATCH] [Updated] " subnut
                   ` (18 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-05-24 13:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1135931685

Comment:
Why is this better than a two-stage read that strips only the module name and version in the first part, then does a more targeted split on the remainder once its expected form is established?

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (42 preceding siblings ...)
  2022-05-24 13:34 ` ahesford
@ 2022-06-22  7:04 ` subnut
  2022-06-22  7:10 ` [PR REVIEW] " subnut
                   ` (17 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  7:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10811 bytes --]

From 5e0e161b720b6d4cb0d3537f4667604dbab1aad2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.4

files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.4

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 22 ++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..104f2096070e 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=,:/ read -r name vers _ arch status; do
+        [ "$status" = installed ] || continue
+        echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+        /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+    done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..24d2d3165428 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.4
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=a0d4832ffd7d91dd75387735977d319bc7d09a42e8b347a1bf79290e3cdffaf4
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From c3bec877f0ff1add8510f49ccb982fb9346499df Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 14ce2e322d383fefe68fdccb41d2ab86eb54656b Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 123f7520e926b11cc09b6eb5ec27156e5c31bc10 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From f0053c8212102623712792b4c05fbdbbcacba1aa Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

	module-name, x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and poor
dkms would get confused trying to find a kernel of version "added".
---
 srcpkgs/xbps-triggers/files/dkms | 25 ++++++++++++++++---------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..69121db88da4 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,26 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
+	local modname modver kver arch status _
 
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" \
+			| tr '/' ' ' \
+			| sed 's/[,:] / /g' \
+			| while read -r modname modver kver arch status _; do
+			if [ "$kver" = added ] && [ -z "$status" ] && [ -z "$arch" ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (43 preceding siblings ...)
  2022-06-22  7:04 ` [PR PATCH] [Updated] " subnut
@ 2022-06-22  7:10 ` subnut
  2022-06-22  7:32 ` subnut
                   ` (16 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  7:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903364817

Comment:
**UPDATE:**
No, there is no concern that `,` `:` `/` characters might appear in any of the fields.  
`dkms` itself assumes so.

https://github.com/dell/dkms/blob/ea97ad27efb4d227242e322f9d30c7280a6eba47/kernel_prerm.d_dkms#L7-L11

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (44 preceding siblings ...)
  2022-06-22  7:10 ` [PR REVIEW] " subnut
@ 2022-06-22  7:32 ` subnut
  2022-06-22  8:04 ` [PR PATCH] [Updated] " subnut
                   ` (15 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  7:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 269 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903384949

Comment:
Your above example doesn't print `done.` or `FAILED!` after the `... ` to indicated whether the action succeeded or failed.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (45 preceding siblings ...)
  2022-06-22  7:32 ` subnut
@ 2022-06-22  8:04 ` subnut
  2022-06-22  8:05 ` subnut
                   ` (14 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10796 bytes --]

From 5e0e161b720b6d4cb0d3537f4667604dbab1aad2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.4

files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.4

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 22 ++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..104f2096070e 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=,:/ read -r name vers _ arch status; do
+        [ "$status" = installed ] || continue
+        echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+        /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+    done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..24d2d3165428 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.4
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=a0d4832ffd7d91dd75387735977d319bc7d09a42e8b347a1bf79290e3cdffaf4
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From c3bec877f0ff1add8510f49ccb982fb9346499df Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From 14ce2e322d383fefe68fdccb41d2ab86eb54656b Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From 123f7520e926b11cc09b6eb5ec27156e5c31bc10 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From 8d5cc88445ea12994a4888dcd708309502846253 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

old -	module-name, x.y.z: added
new -	module-name/x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and dkms
would get confused trying to find a kernel of version "added".

This commit fixes that bug.
---
 srcpkgs/xbps-triggers/files/dkms | 25 +++++++++++++++----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..9fe8c91c4d56 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,24 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
-
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while read -r line; do
+			read -r modname modver kver arch status _ <<-EOF
+			$line
+			EOF
+			if echo "$line" | grep -q ': added$'; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (46 preceding siblings ...)
  2022-06-22  8:04 ` [PR PATCH] [Updated] " subnut
@ 2022-06-22  8:05 ` subnut
  2022-06-22  8:07 ` subnut
                   ` (13 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10796 bytes --]

From c8468da6dc3956167ee0085c8d6c3062b0c9c2d0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.4

files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.4

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 22 ++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..104f2096070e 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=,:/ read -r name vers _ arch status; do
+        [ "$status" = installed ] || continue
+        echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+        /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+    done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..24d2d3165428 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.4
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=a0d4832ffd7d91dd75387735977d319bc7d09a42e8b347a1bf79290e3cdffaf4
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 8bb403c8fb743de71588b2e42d684ba7265277d8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From d8652a73bc836e7fc2ac7241454855e857e6e936 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From bdd941c8164d1e7a77967000a6e960eb39e1f0a8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From a014c87f9560d727b91bad844607462a095d9c39 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

old -	module-name, x.y.z: added
new -	module-name/x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and dkms
would get confused trying to find a kernel of version "added".

This commit fixes that bug.
---
 srcpkgs/xbps-triggers/files/dkms | 25 +++++++++++++++----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..9fe8c91c4d56 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,24 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
-
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while read -r line; do
+			read -r modname modver kver arch status _ <<-EOF
+			$line
+			EOF
+			if echo "$line" | grep -q ': added$'; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.3 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (47 preceding siblings ...)
  2022-06-22  8:05 ` subnut
@ 2022-06-22  8:07 ` subnut
  2022-06-22  8:16 ` dkms: update to 3.0.4 " subnut
                   ` (12 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.3 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 10804 bytes --]

From c8468da6dc3956167ee0085c8d6c3062b0c9c2d0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/5] dkms: update to 3.0.4

files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.4

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 22 ++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..104f2096070e 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=,:/ read -r name vers _ arch status; do
+        [ "$status" = installed ] || continue
+        echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+        /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+    done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..24d2d3165428 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.4
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=a0d4832ffd7d91dd75387735977d319bc7d09a42e8b347a1bf79290e3cdffaf4
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 8bb403c8fb743de71588b2e42d684ba7265277d8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/5] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From d8652a73bc836e7fc2ac7241454855e857e6e936 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/5] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From bdd941c8164d1e7a77967000a6e960eb39e1f0a8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:22:10 +0530
Subject: [PATCH 4/5] zfs: remove deprecated dkms directive

---
 .../zfs/patches/0001-only-build-the-module-in-dkms.conf.patch | 4 ++--
 srcpkgs/zfs/template                                          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
index cd9e890ab76e..63b8421c3551 100644
--- a/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
+++ b/srcpkgs/zfs/patches/0001-only-build-the-module-in-dkms.conf.patch
@@ -29,10 +29,10 @@ index 88c289383..5a859a0e0 100755
    --with-linux-obj="\${kernel_source_dir}"
    \$(
      [[ -n \"\${ICP_ROOT}\" ]] && \\
-@@ -69,7 +54,7 @@ POST_BUILD="scripts/dkms.postbuild
+@@ -69,7 +54,6 @@ POST_BUILD="scripts/dkms.postbuild
  "
  AUTOINSTALL="yes"
- REMAKE_INITRD="no"
+-REMAKE_INITRD="no"
 -MAKE[0]="make"
 +MAKE[0]="make -C module/"
  STRIP[0]="\$(
diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template
index 6c7b69345fd3..f820f1384625 100644
--- a/srcpkgs/zfs/template
+++ b/srcpkgs/zfs/template
@@ -1,7 +1,7 @@
 # Template file for 'zfs'
 pkgname=zfs
 version=2.1.4
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-config=user --with-mounthelperdir=/usr/bin
  --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d

From cb0bc89eb2ff087b2dfe4ba1bd949c04f5438df2 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 5/5] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

old -	module-name, x.y.z: added
new -	module-name/x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and dkms
would get confused trying to find a kernel of version "added".

This commit fixes that bug.
---
 srcpkgs/xbps-triggers/files/dkms | 25 +++++++++++++++----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..8c814b27647b 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,24 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
-
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while read -r line; do
+			IFS=,:/ read -r modname modver kver arch status _ <<-EOF
+			$line
+			EOF
+			if echo "$line" | grep -q ': added$'; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (48 preceding siblings ...)
  2022-06-22  8:07 ` subnut
@ 2022-06-22  8:16 ` subnut
  2022-06-22  8:18 ` subnut
                   ` (11 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1162795399

Comment:
Sorry for the delay, I am busy.

---

@ahesford It makes the logic simpler IMO.  

I've updated the logic again, and this time I've only utilized the expected format instead of using workarounds like `$kver = added`. Hope this alleviates your concerns.

If you have any better suggestions, do share. I'll implement it ASAP.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (49 preceding siblings ...)
  2022-06-22  8:16 ` dkms: update to 3.0.4 " subnut
@ 2022-06-22  8:18 ` subnut
  2022-06-22  8:20 ` subnut
                   ` (10 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1162795399

Comment:
Sorry for the delay, I am busy.

---

@ahesford It makes the logic simpler IMO.  

I've updated the logic again, and this time I've only utilized the expected format instead of using workarounds like `$kver = added`. Hope this alleviates your concerns.

If you have any better suggestions, do share. I'll implement it ASAP.

---

Thanks for the `<<-EOF` tip BTW. Didn't know that.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (50 preceding siblings ...)
  2022-06-22  8:18 ` subnut
@ 2022-06-22  8:20 ` subnut
  2022-06-22 12:29 ` [PR REVIEW] " ahesford
                   ` (9 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22  8:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]

New comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#issuecomment-1162798686

Comment:
Reference for `IFS` value -  
https://github.com/dell/dkms/blob/ea97ad27efb4d227242e322f9d30c7280a6eba47/kernel_prerm.d_dkms#L7-L11

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (52 preceding siblings ...)
  2022-06-22 12:29 ` [PR REVIEW] " ahesford
@ 2022-06-22 12:29 ` ahesford
  2022-06-22 14:57 ` subnut
                   ` (7 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-06-22 12:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903678411

Comment:
- Test the `added` before splitting lines, and use shell suffix matching to extract the status instead of `grep`
- Use a `case` statement instead of a pair of `test` invocations to match built and installed modules
- `printf %s "some string"` -> `printf "some string"`; the format insertion is unnecessary here

```suggestion
		$DKMS status -m "$1" | while read -r line; do
			if [ "${line##*: }" = "added" ]; then
				# The module wasn't built successfully for any kernel version; remove it
				printf "Cleaning up DKMS module '$modname-$modver'... "
				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
				continue
			fi

			IFS=,:/ read -r modname modver kver arch status _ <<-EOF
			$line
			EOF

			case "$status" in
			installed|built)
				# The module was installed or built for a kernel version; remove it
				printf "Removing DKMS module '$modname-$modver' for kernel-$kver... "
				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
				;;
			*)
				# Any other status is unexpected; just ignore
				;;
			esac
```

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (51 preceding siblings ...)
  2022-06-22  8:20 ` subnut
@ 2022-06-22 12:29 ` ahesford
  2022-06-22 12:29 ` ahesford
                   ` (8 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-06-22 12:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903680930

Comment:
Is this still deprecated, or now a hard error? We are awaiting an imminent release of ZFS 2.1.5. ZFS rebuilds can be painful on slow machines or with a lot of kernels, so avoiding update thrashing is desirable. If the module will still build without this removal, let's leave ZFS out of the DKMS update.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (53 preceding siblings ...)
  2022-06-22 12:29 ` ahesford
@ 2022-06-22 14:57 ` subnut
  2022-06-22 14:58 ` subnut
                   ` (6 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 14:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903860393

Comment:
> `printf %s "some string"` -> `printf "some string"`; the format insertion is unnecessary here

If `some string` contains any printf directives, then printf would misbehave when invoked as 
```
printf "some string"
```
To avoid that problem, it's generally recommended to invoke printf as
```
printf %s "some string"
```
https://github.com/koalaman/shellcheck/wiki/SC2059

---

In your suggestion, `modname` and `modver` are undefined in lines 30-31.

> Use a case statement instead of a pair of test invocations to match built and installed modules

Why is `case` better? I genuinely don't see any difference between using `case` and `elif [ ... ] || [ ... ]`





^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (54 preceding siblings ...)
  2022-06-22 14:57 ` subnut
@ 2022-06-22 14:58 ` subnut
  2022-06-22 14:58 ` subnut
                   ` (5 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 14:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903861590

Comment:
No, it is not a hard error yet.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (55 preceding siblings ...)
  2022-06-22 14:58 ` subnut
@ 2022-06-22 14:58 ` subnut
  2022-06-22 15:00 ` subnut
                   ` (4 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 14:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903861590

Comment:
No, it is not a hard error yet.

I'll remove this commit as soon as possible.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (56 preceding siblings ...)
  2022-06-22 14:58 ` subnut
@ 2022-06-22 15:00 ` subnut
  2022-06-22 15:25 ` ahesford
                   ` (3 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 15:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 984 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903860393

Comment:
> `printf %s "some string"` -> `printf "some string"`; the format insertion is unnecessary here

If `some string` contains any printf directives, then printf would misbehave when invoked as 
```
printf "some string"
```
To avoid that problem, it's generally recommended to invoke printf as
```
printf %s "some string"
```
https://github.com/koalaman/shellcheck/wiki/SC2059

---

**EDIT:** Also, your above example doesn't print the `done.` or `FAILED!` message after the `"Cleaning up DKMS module $modname-$modver... "`

---

In your suggestion, `modname` and `modver` are undefined in lines 30-31.

> Use a case statement instead of a pair of test invocations to match built and installed modules

Why is `case` better? I genuinely don't see any difference between using `case` and `elif [ ... ] || [ ... ]`





^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (57 preceding siblings ...)
  2022-06-22 15:00 ` subnut
@ 2022-06-22 15:25 ` ahesford
  2022-06-22 15:48 ` [PR PATCH] [Updated] " subnut
                   ` (2 subsequent siblings)
  61 siblings, 0 replies; 63+ messages in thread
From: ahesford @ 2022-06-22 15:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903901895

Comment:
OK, you can leave the format expansion to avoid a shellcheck warning.

I overlooked the need to define `modname` and `modver` to remove `added` modules, so I guess stick with your original if-else but drop the grep in favor of shell prefix matching and string comparison.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR PATCH] [Updated] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (58 preceding siblings ...)
  2022-06-22 15:25 ` ahesford
@ 2022-06-22 15:48 ` subnut
  2022-06-22 16:34 ` [PR REVIEW] " subnut
  2022-06-22 16:35 ` subnut
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 15:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

There is an updated pull request by subnut against master on the void-packages repository

https://github.com/subnut/void-packages dkms
https://github.com/void-linux/void-packages/pull/37139

dkms: update to 3.0.4 and update other related packages
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
<!--
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/37139.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-dkms-37139.patch --]
[-- Type: text/x-diff, Size: 9259 bytes --]

From c8468da6dc3956167ee0085c8d6c3062b0c9c2d0 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:27:07 +0530
Subject: [PATCH 1/4] dkms: update to 3.0.4

files/kernel.d/dkms.prerm has been updated to match the
kernel_prerm.d_dkms file distributed with dkms 3.0.4

Note that these dkms.conf directives have been deprecated
- MODULES_CONF
- MODULES_CONF_ALIAS_TYPE
- MODULES_CONF_OBSOLETES
- MODULES_CONF_OBSOLETE_ONLY
- REMAKE_INITRD

Also, note that the output of `dkms status` was changed in version 2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
---
 srcpkgs/dkms/files/kernel.d/dkms.prerm | 22 ++++++++++------------
 srcpkgs/dkms/template                  | 15 +++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/srcpkgs/dkms/files/kernel.d/dkms.prerm b/srcpkgs/dkms/files/kernel.d/dkms.prerm
index 155e9734aee2..104f2096070e 100644
--- a/srcpkgs/dkms/files/kernel.d/dkms.prerm
+++ b/srcpkgs/dkms/files/kernel.d/dkms.prerm
@@ -1,21 +1,19 @@
-#!/bin/bash
+#!/bin/sh
 
-# We're passed the version of the kernel being installed
+# We're passed the version of the kernel being removed
 PKGNAME="$1"
 VERSION="$2"
 
 if [ -x /usr/bin/dkms ]; then
-while read line; do
-   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
-   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
-   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
-   echo "dkms: removing: $name $vers (${PKGNAME}-${VERSION}) ($arch)" >&2
-   /usr/bin/dkms remove -q -m $name -v $vers -k ${VERSION} -a $arch
-done < <(/usr/bin/dkms status -k ${VERSION} 2>/dev/null | grep ": installed")
+    /usr/bin/dkms status -k "$VERSION" 2>/dev/null | while IFS=,:/ read -r name vers _ arch status; do
+        [ "$status" = installed ] || continue
+        echo "dkms: removing: $name $vers ($PKGNAME-$VERSION) ($arch)" >&2
+        /usr/bin/dkms remove -q -m "$name" -v "$vers" -k "$VERSION" -a "$arch"
+    done
 fi
 
-rmdir \
-	"/lib/modules/${VERSION}/updates/dkms" \
-	"/lib/modules/${VERSION}/updates" 2>/dev/null
+rmdir 2>/dev/null \
+    "/lib/modules/$VERSION/updates/dkms" \
+    "/lib/modules/$VERSION/updates"
 
 exit 0
diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index 32b0211981f8..24d2d3165428 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -1,15 +1,15 @@
 # Template file for 'dkms'
 pkgname=dkms
-version=2.8.4
-revision=2
+version=3.0.4
+revision=1
 conf_files="/etc/dkms/framework.conf"
 depends="bash kmod gcc make coreutils"
-short_desc="Dynamic Kernel Modules System"
+short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
 homepage="https://github.com/dell/dkms"
-distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=540912bf0d845ac333f6971a3ccb80911c770a042af1b30ffbb9b420ac979af3
+distfiles="https://github.com/dell/dkms/archive/v${version}.tar.gz"
+checksum=a0d4832ffd7d91dd75387735977d319bc7d09a42e8b347a1bf79290e3cdffaf4
 
 case "$XBPS_TARGET_MACHINE" in
 	# Too many competing kernels for arm* to depend on linux-headers
@@ -21,11 +21,14 @@ if [ "$CROSS_BUILD" ]; then
 	depends+=" openssl-devel gmp-devel libada-devel libmpc-devel flex"
 fi
 
+do_build() {
+	make dkms dkms.8
+}
+
 do_install() {
 	# We are only interested in the bare minimum.
 	vbin dkms
 	vman dkms.8
-	vinstall dkms_dbversion 644 var/lib/dkms
 	vcompletion dkms.bash-completion bash dkms
 	vinstall dkms_framework.conf 644 etc/dkms framework.conf
 	# Kernel hooks.

From 8bb403c8fb743de71588b2e42d684ba7265277d8 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:17:19 +0530
Subject: [PATCH 2/4] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 srcpkgs/broadcom-wl-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/broadcom-wl-dkms/files/dkms.conf b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
index a6219f4c89b8..96acd0dc2092 100644
--- a/srcpkgs/broadcom-wl-dkms/files/dkms.conf
+++ b/srcpkgs/broadcom-wl-dkms/files/dkms.conf
@@ -3,4 +3,3 @@ PACKAGE_VERSION="@VERSION@"
 BUILT_MODULE_NAME[0]="wl"
 DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD="yes"
diff --git a/srcpkgs/broadcom-wl-dkms/template b/srcpkgs/broadcom-wl-dkms/template
index 55bc9c0e1d36..686f11a6d6dd 100644
--- a/srcpkgs/broadcom-wl-dkms/template
+++ b/srcpkgs/broadcom-wl-dkms/template
@@ -2,7 +2,7 @@
 
 pkgname=broadcom-wl-dkms
 version=6.30.223.271
-revision=11
+revision=12
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:Proprietary Broadcom license"
 homepage="http://broadcom.com"

From d8652a73bc836e7fc2ac7241454855e857e6e936 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 15 May 2022 12:18:55 +0530
Subject: [PATCH 3/4] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 srcpkgs/rtl8822bu-dkms/template        | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rtl8822bu-dkms/files/dkms.conf b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
index 3156be8132bc..243a32dbebca 100644
--- a/srcpkgs/rtl8822bu-dkms/files/dkms.conf
+++ b/srcpkgs/rtl8822bu-dkms/files/dkms.conf
@@ -8,4 +8,3 @@ KSRC=/lib/modules/${kernelver}/build"
 CLEAN="make clean"
 DEST_MODULE_LOCATION="/kernel/drivers/net/wireless"
 AUTOINSTALL="yes"
-REMAKE_INITRD=no
diff --git a/srcpkgs/rtl8822bu-dkms/template b/srcpkgs/rtl8822bu-dkms/template
index 548d0b6299cd..61b92f58464d 100644
--- a/srcpkgs/rtl8822bu-dkms/template
+++ b/srcpkgs/rtl8822bu-dkms/template
@@ -1,7 +1,7 @@
 # Template file for 'rtl8822bu-dkms'
 pkgname=rtl8822bu-dkms
 version=20201222
-revision=1
+revision=2
 _gitrev=fcfd4ecca1512d4cd2db4aa91679576d2a5ab8eb
 wrksrc="rtl8822bu-${_gitrev}"
 depends="dkms"

From ad3535ecce38bd7daf6af85ba55a0982c5edcfb1 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Wed, 18 May 2022 09:46:58 +0530
Subject: [PATCH 4/4] xbps-triggers: dkms trigger updated and bugfixed

The output format of `dkms status` has changed in v2.8.6
old -	zfs, 2.1.4, 5.15.39_1, x86_64: installed
new -	zfs/2.1.4, 5.15.39_1, x86_64: installed
So, I've re-worked the _modver and _kver detection logic.

NOTE: The detection logic should ideally be identical to the detection
logic in srcpkgs/dkms/files/kernel.d/dkms.prerm

Also, there was a bug. If a package tried to install a dkms module that
failed to build for *all* of the installed kernels, then the output of
dkms status for that module would be -

old -	module-name, x.y.z: added
new -	module-name/x.y.z: added

Which would cause the dkms trigger to set _kver to "added", and then the
following call to `dkms remove` would set the flag `-k $_kver`, and dkms
would get confused trying to find a kernel of version "added".

This commit fixes that bug.
---
 srcpkgs/xbps-triggers/files/dkms | 25 +++++++++++++++----------
 srcpkgs/xbps-triggers/template   |  2 +-
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..f80f23c1dd47 100755
--- a/srcpkgs/xbps-triggers/files/dkms
+++ b/srcpkgs/xbps-triggers/files/dkms
@@ -2,7 +2,7 @@
 #
 # DKMS trigger. Used to add/build/install or remove the specified modules
 # from all kernels.
-# 
+#
 # Modules can be specified like:
 #  dkms_modules="<modulename> <version> ..."
 #
@@ -21,19 +21,24 @@ UPDATE="$5"
 export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
 
 remove_modules() {
-	local _modver _kver
-
 	# Remove the specified modules from all kernels.
 	set -- ${dkms_modules}
 	while [ $# -gt 0 ]; do
-		$DKMS status -m "$1" | while read line; do
-			if $(echo "$line" | egrep -vq '(added|built|installed)'); then
-				shift 2; continue
+		$DKMS status -m "$1" | while read -r line; do
+			IFS=,:/ read -r modname modver kver arch status _ <<-EOF
+			$line
+			EOF
+			if [ "${line#*: }" = added ]; then
+				# The module wasn't built successfully for any kernel version
+				printf %s "Cleaning up DKMS module '$modname-$modver'... "
+				$DKMS remove -m "$modname" -v "$modver" >/dev/null 2>&1
+			elif [ "$status" = installed ] || [ "$status" = built ]; then
+				printf %s "Removing DKMS module '$modname-$modver' for kernel-$kver... "
+				$DKMS remove -m "$modname" -v "$modver" -k "$kver" >/dev/null 2>&1
+			else
+				# Invalid output
+				continue
 			fi
-			_modver=$(echo "$line"|sed "s/$1,[[:blank:]]\([^,]*\)[,:].*/\1/;t;d")
-			_kver=$(echo "$line"|awk '{print $3}'|sed "s/\(.*\),$/\1/")
-			echo -n "Removing DKMS module '${1}-${_modver}' for kernel-${_kver}... "
-			$DKMS remove -m "$1" -v "${_modver}" -k "${_kver}" >/dev/null 2>&1
 			if [ $? -eq 0 ]; then
 				echo "done."
 			else
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index b1e4f34a4dde..f0249f6f9964 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.122
+version=0.123
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (59 preceding siblings ...)
  2022-06-22 15:48 ` [PR PATCH] [Updated] " subnut
@ 2022-06-22 16:34 ` subnut
  2022-06-22 16:35 ` subnut
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 16:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 154 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903997408

Comment:
Removed.

^ permalink raw reply	[flat|nested] 63+ messages in thread

* Re: [PR REVIEW] dkms: update to 3.0.4 and update other related packages
  2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
                   ` (60 preceding siblings ...)
  2022-06-22 16:34 ` [PR REVIEW] " subnut
@ 2022-06-22 16:35 ` subnut
  61 siblings, 0 replies; 63+ messages in thread
From: subnut @ 2022-06-22 16:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/37139#discussion_r903998246

Comment:
Done.

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2022-06-22 16:35 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 and update other related packages subnut
2022-05-15  8:24 ` [PR PATCH] [Updated] " subnut
2022-05-15  8:35 ` [PR REVIEW] " subnut
2022-05-15  8:37 ` [PR PATCH] [Updated] " subnut
2022-05-15  9:07 ` [PR REVIEW] " subnut
2022-05-15 11:37 ` subnut
2022-05-15 11:40 ` subnut
2022-05-15 11:41 ` subnut
2022-05-15 11:41 ` subnut
2022-05-16  5:02 ` [PR PATCH] [Updated] " subnut
2022-05-17 12:39 ` [PR REVIEW] " ahesford
2022-05-17 12:39 ` ahesford
2022-05-17 12:39 ` ahesford
2022-05-18  2:48 ` subnut
2022-05-18  2:48 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:04 ` [PR REVIEW] " subnut
2022-05-18  4:04 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:16 ` [PR REVIEW] " subnut
2022-05-18  4:17 ` [PR PATCH] [Updated] " subnut
2022-05-18  4:18 ` subnut
2022-05-18  5:04 ` subnut
2022-05-18  5:05 ` [PR REVIEW] " subnut
2022-05-18  5:10 ` subnut
2022-05-18  5:14 ` [PR PATCH] [Updated] " subnut
2022-05-18 12:40 ` [PR REVIEW] " ahesford
2022-05-18 12:40 ` ahesford
2022-05-18 14:39 ` subnut
2022-05-18 14:54 ` subnut
2022-05-18 14:54 ` subnut
2022-05-18 15:18 ` ahesford
2022-05-18 15:30 ` [PR PATCH] [Updated] " subnut
2022-05-18 16:48 ` subnut
2022-05-18 17:36 ` subnut
2022-05-18 17:37 ` subnut
2022-05-21  1:51 ` [PR REVIEW] " ahesford
2022-05-21  1:51 ` ahesford
2022-05-21  4:08 ` [PR PATCH] [Updated] " subnut
2022-05-21  4:09 ` [PR REVIEW] " subnut
2022-05-21  4:16 ` [PR PATCH] [Updated] " subnut
2022-05-21  4:17 ` [PR REVIEW] " subnut
2022-05-24  2:19 ` [PR PATCH] [Updated] " subnut
2022-05-24  2:19 ` subnut
2022-05-24  2:25 ` subnut
2022-05-24 13:34 ` ahesford
2022-06-22  7:04 ` [PR PATCH] [Updated] " subnut
2022-06-22  7:10 ` [PR REVIEW] " subnut
2022-06-22  7:32 ` subnut
2022-06-22  8:04 ` [PR PATCH] [Updated] " subnut
2022-06-22  8:05 ` subnut
2022-06-22  8:07 ` subnut
2022-06-22  8:16 ` dkms: update to 3.0.4 " subnut
2022-06-22  8:18 ` subnut
2022-06-22  8:20 ` subnut
2022-06-22 12:29 ` [PR REVIEW] " ahesford
2022-06-22 12:29 ` ahesford
2022-06-22 14:57 ` subnut
2022-06-22 14:58 ` subnut
2022-06-22 14:58 ` subnut
2022-06-22 15:00 ` subnut
2022-06-22 15:25 ` ahesford
2022-06-22 15:48 ` [PR PATCH] [Updated] " subnut
2022-06-22 16:34 ` [PR REVIEW] " subnut
2022-06-22 16:35 ` subnut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).