core/dkms/dkms_autoinstaller.patch

45 lines
1.5 KiB
Diff

--- a/usr/lib/dkms/dkms_autoinstaller 2011-07-21 23:06:55.000000000 +0000
+++ b/usr/lib/dkms/dkms_autoinstaller 2011-10-22 16:39:07.000000000 +0000
@@ -20,15 +20,28 @@
if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-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
- log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi }
- alias log_action_begin_msg=log_daemon_msg
- alias log_action_end_msg=log_end_msg
+ if [ -f /etc/arch-release -a -f /etc/rc.d/functions ]; then
+# ArchLinux
+ . /etc/rc.conf
+ . /etc/rc.d/functions
+ alias log_daemon_msg=stat_busy
+ log_end_msg() { if [ "$1" = "0" ]; then stat_done; else stat_fail; fi }
+ alias log_action_begin_msg=printhl
+ alias log_action_end_msg=true
+ else
+# Others/Unknown
+ alias log_daemon_msg=/bin/echo
+ log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi }
+ alias log_action_begin_msg=log_daemon_msg
+ alias log_action_end_msg=log_end_msg
+ fi
fi
+# Guess kernel release
if [ -n "$2" ]; then
kernel="$2"
else
@@ -38,7 +51,7 @@
# See how we were called.
case "$1" in
start)
- log_daemon_msg "dkms: running auto installation service for kernel $kernel"
+ log_daemon_msg "Service auto-install/update modules for kernel $kernel" "dkms"
dkms autoinstall --kernelver $kernel
log_end_msg $?
;;