[arch-commits] Commit in dkms/trunk (PKGBUILD hook.install hook.remove hook.sh)

Sébastien Luttringer seblu at archlinux.org
Thu Nov 3 21:03:57 UTC 2016


    Date: Thursday, November 3, 2016 @ 21:03:56
  Author: seblu
Revision: 279819

upgpkg: dkms 2.3-1

- fix FS#50404
- fix FS#50370
- fix FS#51635

Modified:
  dkms/trunk/PKGBUILD
  dkms/trunk/hook.install
  dkms/trunk/hook.remove
  dkms/trunk/hook.sh

--------------+
 PKGBUILD     |   18 +++++++++---------
 hook.install |    5 ++---
 hook.remove  |    5 ++---
 hook.sh      |   50 ++++++++++++++++++++++++++++++++++----------------
 4 files changed, 47 insertions(+), 31 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-11-03 20:55:37 UTC (rev 279818)
+++ PKGBUILD	2016-11-03 21:03:56 UTC (rev 279819)
@@ -3,11 +3,11 @@
 # Contributor: Balwinder S "bsd" Dheeman (bdheeman AT gmail.com)
 
 pkgname=dkms
-pkgver=2.2.0.3+git151023
-pkgrel=12
+pkgver=2.3
+pkgrel=1
 pkgdesc='Dynamic Kernel Modules System'
 arch=('any')
-url='http://linux.dell.com/dkms/'
+url='https://github.com/dell/dkms'
 license=('GPL2')
 depends=('bash' 'kmod' 'gcc' 'make' 'patch')
 makedepends=('git')
@@ -17,7 +17,7 @@
             'linux-grsec-headers: build modules against the GRSEC kernel')
 backup=('etc/dkms/framework.conf')
 install=$pkgname.install
-source=('git+git://linux.dell.com/dkms.git#commit=7b6e78f'
+source=("git+https://github.com/dell/dkms.git#tag=$pkgver"
         '02-no-kernel-hook.patch'
         'hook.install'
         'hook.remove'
@@ -24,9 +24,9 @@
         'hook.sh')
 md5sums=('SKIP'
          '82d520c39c99c34977e48b313a189c6c'
-         'e6eada07fc3a56a491e14dfeafec746f'
-         '094e692184902a7ee584c84f3a9e375d'
-         'f2a86ab70daba2e8623156f5221152a9')
+         '2dfc9905738199bf1fdbaa08d306e265'
+         '4d959fdd4f168b5a6921712404066566'
+         'c3971151a2945e5491b786579810cd15')
 
 prepare() {
   cd dkms
@@ -35,8 +35,8 @@
   local filename
   for filename in "${source[@]}"; do
     if [[ "$filename" =~ \.patch$ ]]; then
-      msg2 "Applying patch $filename"
-      patch -p1 -N -i "$srcdir/$filename"
+      msg2 "Applying patch ${filename##*/}"
+      patch -p1 -N -i "$srcdir/${filename##*/}"
     fi
   done
 

Modified: hook.install
===================================================================
--- hook.install	2016-11-03 20:55:37 UTC (rev 279818)
+++ hook.install	2016-11-03 21:03:56 UTC (rev 279819)
@@ -3,9 +3,8 @@
 Operation = Upgrade
 Type = File
 Target = usr/src/*/dkms.conf
-Target = usr/lib/modules/*/
-Target = !usr/lib/modules/extramodules-*
-Target = !usr/lib/modules/*/?*
+Target = usr/lib/modules/*/build/include/
+Target = usr/lib/modules/*/kernel/
 
 [Action]
 Description = Install DKMS modules

Modified: hook.remove
===================================================================
--- hook.remove	2016-11-03 20:55:37 UTC (rev 279818)
+++ hook.remove	2016-11-03 21:03:56 UTC (rev 279819)
@@ -3,9 +3,8 @@
 Operation = Remove
 Type = File
 Target = usr/src/*/dkms.conf
-Target = usr/lib/modules/*/
-Target = !usr/lib/modules/extramodules-*
-Target = !usr/lib/modules/*/?*
+Target = usr/lib/modules/*/build/include/
+Target = usr/lib/modules/*/kernel/
 
 [Action]
 Description = Remove DKMS modules

Modified: hook.sh
===================================================================
--- hook.sh	2016-11-03 20:55:37 UTC (rev 279818)
+++ hook.sh	2016-11-03 21:03:56 UTC (rev 279819)
@@ -41,17 +41,13 @@
 # handle actions on module addition/upgrade/removal
 # $1: module name
 # $2: module version
-# $*: dkms args
-do_module() {
-	local modname="$1"; shift
-	local modver="$1"; shift
+# $3: dkms action
+parse_module() {
 	pushd "$install_tree" >/dev/null
-	# do $@ for each kernel with headers for $modname v$modver
 	local path
 	for path in */build/; do
 		local kver="${path%%/*}"
-		check_kernel "$kver" || continue
-		run dkms "$@" -m "$modname" -v "$modver" -k "$kver"
+		dkms_register "$1" "$2" "$kver" "$3"
 	done
 	popd >/dev/null
 }
@@ -58,21 +54,38 @@
 
 # handle actions on kernel addition/upgrade/removal
 # $1: kernel version
-# $*: dkms args
-do_kernel() {
-	local kver="$1"; shift
-	check_kernel "$kver" || return
-	# do $@ once for each dkms module in $source_tree
+# $2: dkms action
+parse_kernel() {
 	local path
 	for path in "$source_tree"/*-*/dkms.conf; do
-		if [[ "$path" =~ ^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; then
-			run dkms "$@" -m "${BASH_REMATCH[1]}" -v "${BASH_REMATCH[2]}" -k "$kver"
+		if [[ -f "$path" && "$path" =~ ^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; then
+			dkms_register "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "$1" "$2"
 		fi
 	done
 }
 
+# register a dkms call
+# this function suppress echo call for a module
+# $1: module name, $2: module version, $3: kernel version, $4: action
+dkms_register() {
+	DKMS_ACTION["$1/$2/$3"]="$4"
+}
+
+# run registered dkms commands
+dkms_run() {
+	local modname modver kver args nvk
+	for nvk in "${!DKMS_ACTION[@]}"; do
+		mod=${nvk%/*}
+		kver=${nvk##*/}
+		check_kernel "$kver" || return
+		run dkms "${DKMS_ACTION[$nvk]}" "$mod" -k "$kver"
+	done
+}
+
 # emulated program entry point
 main() {
+	[[ -n "$DKMS_ALPM_HOOK_DEBUG" ]] && set -x
+
 	# prevent to have all each dkms call to fail
 	if (( EUID )); then
 		echo 'You must be root to use this hook' >&2
@@ -100,15 +113,20 @@
 		fi
 	done
 
+	# Storage for DKMS action to run
+	declare -A DKMS_ACTION
+
 	# parse stdin paths to guess what do do
 	while read -r path; do
 		if [[ "/$path" =~ ^$source_tree/([^/]+)-([^/]+)/dkms\.conf$ ]]; then
-			do_module "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "$@"
+			parse_module "${BASH_REMATCH[1]}" "${BASH_REMATCH[2]}" "$@"
 		elif [[ "/$path" =~ ^$install_tree/([^/]+)/ ]]; then
-			do_kernel "${BASH_REMATCH[1]}" "$@"
+			parse_kernel "${BASH_REMATCH[1]}" "$@"
 		fi
 	done
 
+	dkms_run
+
 	return 0
 }
 



More information about the arch-commits mailing list