Github messages for voidlinux
 help / color / mirror / Atom feed
From: subnut <subnut@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] dkms: update to 3.0.6 and update other related packages
Date: Sun, 31 Jul 2022 20:37:25 +0200	[thread overview]
Message-ID: <20220731183725.FLvL1j-Rt6hVHWgcNbgWNBsr3fPLl3yHS8_lcU1Tn7g@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37139@inbox.vuxu.org>

[-- 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.6 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: 8845 bytes --]

From 90ec669db77059199c1400338497e155d6ef29f7 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.6

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

Also, note that these dkms.conf directives have been deprecated since
dkms 2.8.8
- 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..1c4e52a073aa 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..ac1ccecffa53 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.6
+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=1e1ae273d2a72e3a89b829f3c72f482fb903f12cf766c054d11612e1d70795b4
 
 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 56d0168ba79da4693c9532b3c3b850a9fc06b336 Mon Sep 17 00:00:00 2001
From: Subhaditya Nath <sn03.general@gmail.com>
Date: Sun, 31 Jul 2022 23:49:34 +0530
Subject: [PATCH 2/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/dkms/template            |  2 +-
 srcpkgs/xbps-triggers/files/dkms | 25 +++++++++++++++----------
 srcpkgs/xbps-triggers/template   |  2 +-
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/srcpkgs/dkms/template b/srcpkgs/dkms/template
index ac1ccecffa53..ee16e8c3aeb5 100644
--- a/srcpkgs/dkms/template
+++ b/srcpkgs/dkms/template
@@ -3,7 +3,7 @@ pkgname=dkms
 version=3.0.6
 revision=1
 conf_files="/etc/dkms/framework.conf"
-depends="bash kmod gcc make coreutils"
+depends="bash kmod gcc make coreutils xbps-triggers>=0.123_1"
 short_desc="Dynamic Kernel Module Support"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="GPL-2.0-or-later"
diff --git a/srcpkgs/xbps-triggers/files/dkms b/srcpkgs/xbps-triggers/files/dkms
index fcd64efd0301..6b285c576b53 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"

From 86a3c6eefa2c2053671b2f1e6e3faf8296c82859 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 3/4] broadcom-wl-dkms: remove deprecated dkms directive

---
 srcpkgs/broadcom-wl-dkms/files/dkms.conf | 1 -
 1 file changed, 1 deletion(-)

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"

From e7bd4bb4c4c30c472d3e2cd95e44120a86154870 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 4/4] rtl8822bu-dkms: remove deprecated dkms directive

---
 srcpkgs/rtl8822bu-dkms/files/dkms.conf | 1 -
 1 file changed, 1 deletion(-)

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

  parent reply	other threads:[~2022-07-31 18:37 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15  7:57 [PR PATCH] dkms: update to 3.0.3 " 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
2022-07-20 12:15 ` [PR PATCH] [Updated] " subnut
2022-07-20 12:17 ` subnut
2022-07-20 12:19 ` dkms: update to 3.0.6 " subnut
2022-07-21 14:31 ` [PR REVIEW] " ahesford
2022-07-21 16:23 ` ahesford
2022-07-21 16:23 ` ahesford
2022-07-31 18:27 ` [PR PATCH] [Updated] " subnut
2022-07-31 18:28 ` [PR REVIEW] " subnut
2022-07-31 18:32 ` [PR PATCH] [Updated] " subnut
2022-07-31 18:37 ` subnut [this message]
2022-07-31 18:41 ` subnut
2022-07-31 18:59 ` subnut
2022-07-31 19:00 ` subnut
2022-08-23 11:18 ` dataCobra
2022-08-29 20:25 ` [PR PATCH] [Closed]: " ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220731183725.FLvL1j-Rt6hVHWgcNbgWNBsr3fPLl3yHS8_lcU1Tn7g@z \
    --to=subnut@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).