Mageia Bugzilla – Attachment 14355 Details for
Bug 31835
Update dkms to version 3.0.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Patch to replace alias by functions
dkms-3.0.12-replacealias.patch (text/plain), 2.89 KB, created by
katnatek
on 2024-02-10 03:46:56 CET
(
hide
)
Description:
Patch to replace alias by functions
Filename:
MIME Type:
Creator:
katnatek
Created:
2024-02-10 03:46:56 CET
Size:
2.89 KB
patch
obsolete
>Index: dkms-3.0.12/dkms_autoinstaller.in >=================================================================== >--- dkms-3.0.12/dkms_autoinstaller.in >+++ dkms-3.0.12/dkms_autoinstaller.in 2024-02-09 20:31:50.583580121 -0600 >@@ -23,14 +23,91 @@ > . /etc/rc.d/init.d/functions > fi > >-# We only have these functions on Debian/Ubuntu >-# so on other distros just stub them out >-if [ ! -f /etc/debian_version ]; then >- alias log_daemon_msg='/bin/echo -n' >- log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } >- alias log_action_msg=/bin/echo >+#!/bin/sh >+# >+# dkms_autoinstaller - A service to automatically install DKMS modules for new kernels. >+# >+# chkconfig: 345 04 04 >+# description: Compiles and install kernel modules automatically for new \ >+# kernels at boot. >+ >+### BEGIN INIT INFO >+# Provides: dkms_autoinstaller dkms >+# Default-Start: 3 4 5 >+# Default-Stop: 0 1 2 6 >+# Required-Start: $local_fs >+# Required-Stop: $local_fs >+# Short-Description: DKMS kernel modules installer service >+# Description: A service to automatically install DKMS modules for new kernels. >+### END INIT INFO >+ >+ >+if [ -f /lib/lsb/init-functions ]; then >+ . /lib/lsb/init-functions >+elif [ -f /etc/rc.d/init.d/functions ]; then >+ . /etc/rc.d/init.d/functions > fi > >+# Replace functions for Debian/Ubuntu >+ >+log_daemon_msg() { /bin/echo -n "$1"; } >+log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } >+log_action_msg() { /bin/echo "$1"; } >+ >+exec="@SBINDIR@/dkms" >+prog=${exec##*/} >+ >+test -f $exec || exit 0 >+ >+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog >+ >+uname_s=$(uname -s) >+ >+_get_kernel_dir() { >+ KVER=$1 >+ case ${uname_s} in >+ Linux) DIR="/lib/modules/$KVER/build" ;; >+ GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; >+ esac >+ echo $DIR >+} >+ >+_check_kernel_dir() { >+ DIR=$(_get_kernel_dir $1) >+ case ${uname_s} in >+ Linux) test -e $DIR/include ;; >+ GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;; >+ *) return 1 ;; >+ esac >+ return $? >+} >+ >+case "$1" in >+ start) >+ if [ -n "$2" ]; then >+ kernel="$2" >+ else >+ kernel=$(uname -r) >+ fi >+ if [ -f /etc/dkms/no-autoinstall ]; then >+ log_action_msg "$prog: autoinstall for dkms modules has been disabled" >+ elif ! _check_kernel_dir $kernel; then >+ log_action_msg "$prog: autoinstall for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed" >+ else >+ log_daemon_msg "$prog: running auto installation service for kernel $kernel" >+ dkms autoinstall --kernelver $kernel >+ log_end_msg $? >+ fi >+ ;; >+ stop|restart|force-reload|status|reload) >+ # There is no stop action, this and the 04 priority during stop is >+ # added to make RHEL chkconfig happy. >+ # Ignore others on debian/ubuntu too >+ ;; >+ *) >+ echo "Usage: $0 {start}" >+ exit 2;; >+esac > exec="@SBINDIR@/dkms" > prog=${exec##*/} >
Index: dkms-3.0.12/dkms_autoinstaller.in =================================================================== --- dkms-3.0.12/dkms_autoinstaller.in +++ dkms-3.0.12/dkms_autoinstaller.in 2024-02-09 20:31:50.583580121 -0600 @@ -23,14 +23,91 @@ . /etc/rc.d/init.d/functions fi -# We only have these functions on Debian/Ubuntu -# so on other distros just stub them out -if [ ! -f /etc/debian_version ]; then - alias log_daemon_msg='/bin/echo -n' - log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } - alias log_action_msg=/bin/echo +#!/bin/sh +# +# dkms_autoinstaller - A service to automatically install DKMS modules for new kernels. +# +# chkconfig: 345 04 04 +# description: Compiles and install kernel modules automatically for new \ +# kernels at boot. + +### BEGIN INIT INFO +# Provides: dkms_autoinstaller dkms +# Default-Start: 3 4 5 +# Default-Stop: 0 1 2 6 +# Required-Start: $local_fs +# Required-Stop: $local_fs +# Short-Description: DKMS kernel modules installer service +# Description: A service to automatically install DKMS modules for new kernels. +### END INIT INFO + + +if [ -f /lib/lsb/init-functions ]; then + . /lib/lsb/init-functions +elif [ -f /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions fi +# Replace functions for Debian/Ubuntu + +log_daemon_msg() { /bin/echo -n "$1"; } +log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } +log_action_msg() { /bin/echo "$1"; } + +exec="@SBINDIR@/dkms" +prog=${exec##*/} + +test -f $exec || exit 0 + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +uname_s=$(uname -s) + +_get_kernel_dir() { + KVER=$1 + case ${uname_s} in + Linux) DIR="/lib/modules/$KVER/build" ;; + GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; + esac + echo $DIR +} + +_check_kernel_dir() { + DIR=$(_get_kernel_dir $1) + case ${uname_s} in + Linux) test -e $DIR/include ;; + GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;; + *) return 1 ;; + esac + return $? +} + +case "$1" in + start) + if [ -n "$2" ]; then + kernel="$2" + else + kernel=$(uname -r) + fi + if [ -f /etc/dkms/no-autoinstall ]; then + log_action_msg "$prog: autoinstall for dkms modules has been disabled" + elif ! _check_kernel_dir $kernel; then + log_action_msg "$prog: autoinstall for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed" + else + log_daemon_msg "$prog: running auto installation service for kernel $kernel" + dkms autoinstall --kernelver $kernel + log_end_msg $? + fi + ;; + stop|restart|force-reload|status|reload) + # There is no stop action, this and the 04 priority during stop is + # added to make RHEL chkconfig happy. + # Ignore others on debian/ubuntu too + ;; + *) + echo "Usage: $0 {start}" + exit 2;; +esac exec="@SBINDIR@/dkms" prog=${exec##*/}
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31835
:
14222
|
14223
|
14224
|
14225
|
14344
|
14353
|
14354
| 14355 |
14434
|
14588