[arch-commits] Commit in dkms/trunk (7 files)
Sébastien Luttringer
seblu at archlinux.org
Fri Feb 19 01:27:14 UTC 2016
Date: Friday, February 19, 2016 @ 02:27:13
Author: seblu
Revision: 162398
upgpkg: dkms 2.2.0.3+git151023-2
- remove systemd service
- use alpm hooks to build dkms modules
Added:
dkms/trunk/alpm-hook
dkms/trunk/dkms.hook
Modified:
dkms/trunk/PKGBUILD
dkms/trunk/dkms.install
Deleted:
dkms/trunk/dkms.default
dkms/trunk/dkms.service
dkms/trunk/dkms.systemd
--------------+
PKGBUILD | 21 ++++++++-----------
alpm-hook | 29 +++++++++++++++++++++++++++
dkms.default | 9 --------
dkms.hook | 11 ++++++++++
dkms.install | 16 +++++++++-----
dkms.service | 11 ----------
dkms.systemd | 61 ---------------------------------------------------------
7 files changed, 59 insertions(+), 99 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-02-19 00:18:47 UTC (rev 162397)
+++ PKGBUILD 2016-02-19 01:27:13 UTC (rev 162398)
@@ -4,7 +4,7 @@
pkgname=dkms
pkgver=2.2.0.3+git151023
-pkgrel=1
+pkgrel=2
pkgdesc='Dynamic Kernel Modules System'
arch=('any')
url='http://linux.dell.com/dkms/'
@@ -13,18 +13,16 @@
makedepends=('git')
optdepends=('linux-headers: build modules against Arch kernel'
'linux-lts-headers: build modules against LTS Arch kernel')
-backup=('etc/dkms/framework.conf' 'etc/default/dkms')
+backup=('etc/dkms/framework.conf')
install=$pkgname.install
source=('git+git://linux.dell.com/dkms.git#commit=7b6e78f'
'02-no-kernel-hook.patch'
- "$pkgname.default"
- "$pkgname.service"
- "$pkgname.systemd")
+ 'alpm-hook'
+ "$pkgname.hook")
md5sums=('SKIP'
'82d520c39c99c34977e48b313a189c6c'
- '33be2fbf1bcc1b3fb2f38d9e7eaa809d'
- '02e9744e3fdc3d2f68e46966fb32e260'
- '0158265dace30b6cdd06244e844b3e5f')
+ '87715a4b2f8520eb85b380fa5509ac10'
+ '579ec5e7d91acbf75eaf0ed154864a05')
prepare() {
cd dkms
@@ -44,10 +42,9 @@
}
package() {
- # systemd
- install -D -m 644 $pkgname.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
- install -D -m 755 $pkgname.systemd "$pkgdir/usr/lib/systemd/scripts/$pkgname"
- install -D -m 644 $pkgname.default "$pkgdir/etc/default/$pkgname"
+ # alpm hook
+ install -D -m 644 dkms.hook "$pkgdir/usr/share/libalpm/hooks/dkms.hook"
+ install -D -m 755 alpm-hook "$pkgdir/usr/lib/dkms/alpm-hook"
# upstream installer
cd dkms
make \
Added: alpm-hook
===================================================================
--- alpm-hook (rev 0)
+++ alpm-hook 2016-02-19 01:27:13 UTC (rev 162398)
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Copyright © Sébastien Luttringer
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+if (( EUID )); then
+ echo 'You must be root to use this hook' >&2
+ exit 1
+fi
+
+# build modules for all kernels
+cd /usr/lib/modules
+for buildpath in */build; do
+ [[ -d "$buildpath" ]] || continue
+ dkms autoinstall -k "${buildpath%/*}"
+done
Property changes on: dkms/trunk/alpm-hook
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Deleted: dkms.default
===================================================================
--- dkms.default 2016-02-19 00:18:47 UTC (rev 162397)
+++ dkms.default 2016-02-19 01:27:13 UTC (rev 162398)
@@ -1,9 +0,0 @@
-# vim:set ts=2 sw=2 ft=sh noet:
-
-# With LOAD set to yes, modules listed as installed will be loaded with
-# systemctl start dkms.service. Default is yes.
-LOAD=yes
-
-# With UNLOAD set to yes, modules listed as installed will be unloaded with
-# systemctl stop dkms.service. Default is no.
-UNLOAD=no
Added: dkms.hook
===================================================================
--- dkms.hook (rev 0)
+++ dkms.hook 2016-02-19 01:27:13 UTC (rev 162398)
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = *-dkms
+
+[Action]
+Description = Build required modules
+Depends = dkms
+When = PostTransaction
+Exec = /usr/lib/dkms/alpm-hook
Modified: dkms.install
===================================================================
--- dkms.install 2016-02-19 00:18:47 UTC (rev 162397)
+++ dkms.install 2016-02-19 01:27:13 UTC (rev 162398)
@@ -1,13 +1,17 @@
-#!/bin/sh
+#!/bin/bash
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
- if [ "$(vercmp $2 2.2.0.3-12)" -le 0 ]; then
- cat << EOF
-===> dkms startup config file moved to /etc/default/dkms
-EOF
- fi
+ if (( "$(vercmp $2 2.2.0.3-12)" <= 0 )); then
+ echo '===> dkms startup config file moved to /etc/default/dkms'
+ fi
+
+ if (( "$(vercmp $2 '2.2.0.3+git151023-2')" <= 0 )); then
+ echo '===> dkms systemd service has been removed'
+ echo '===> modules building is now handled by alpm hooks at install time'
+ echo '===> startup modules loading must be done via modules-load.d'
+ fi
}
# vim:set ts=2 sw=2 ft=sh et:
Deleted: dkms.service
===================================================================
--- dkms.service 2016-02-19 00:18:47 UTC (rev 162397)
+++ dkms.service 2016-02-19 01:27:13 UTC (rev 162398)
@@ -1,11 +0,0 @@
-[Unit]
-Description=Dynamic Kernel Modules System
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=/usr/lib/systemd/scripts/dkms start
-ExecStop=/usr/lib/systemd/scripts/dkms stop
-
-[Install]
-WantedBy=multi-user.target
Deleted: dkms.systemd
===================================================================
--- dkms.systemd 2016-02-19 00:18:47 UTC (rev 162397)
+++ dkms.systemd 2016-02-19 01:27:13 UTC (rev 162398)
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-. /etc/default/dkms
-
-# list dkms modules for the current running kernel
-list_dkms_modules() {
- shopt -s nullglob
- declare -a DKMS_MOULES
- # dkms status needs uname -r to list correctly intalled version for current kernel
- local modules_path=($(dkms status -k "$(uname -r)"|sed -rn 's#(.*), (.*), (.*), (.*): installed#\1/\2/\3/\4#p'))
- for p in "${modules_path[@]}"; do
- for m in /var/lib/dkms/"$p"/module/*.ko{,gz}; do
- m=${m##*/}
- m=${m%.gz}
- m=${m%.ko}
- DKMS_MODULES+=("$m")
- done
- done
-}
-
-# load installed kernel modules for the current kernel version
-load_dkms_modules() {
- local ret=0
- list_dkms_modules
- for m in "${DKMS_MODULES[@]}"; do
- modprobe -b "$m"
- ret+=$?
- done
- return $ret
-}
-
-# unload installed kernel modules for the current kernel version
-unload_dkms_modules() {
- list_dkms_modules
- # ask for removal
- for m in "${DKMS_MODULES[@]}"; do
- modprobe --remove --quiet "$m"
- done
- # check modules are unloaded
- # sometimes modprobe -r fail but modules are removed
- for m in "${DKMS_MODULES[@]}"; do
- [[ -e /sys/modules/$m ]] && return 1
- done
- return 0
-}
-
-case "$1" in
- start)
- dkms autoinstall -k "$(uname -r)"
- [[ $LOAD =~ [Yy][Ee][Ss] ]] && load_dkms_modules
- ;;
- stop)
- [[ $UNLOAD =~ [Yy][Ee][Ss] ]] && unload_dkms_modules
- ;;
- *)
- echo "usage: $0 {start|stop}" >&2
- ;;
-esac
-
-:
-# vim:set ts=2 sw=2 ft=sh et:
More information about the arch-commits
mailing list