~ubuntu-branches/debian/stretch/dkms/stretch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
#
# dkms_autoinstaller        A service to automatically install DKMS modules
#                           for new kernels.
# chkconfig: 345 04 04
# description: An autoinstaller bootup service for DKMS
#
### BEGIN INIT INFO
# Provides: dkms_autoinstaller dkms
# Default-Start: 2 3 4 5
# Default-Stop:
# Required-Start: $local_fs
# Required-Stop: $null
# Short-Description: Automatically install DKMS modules for new kernels
# Description: A service to automatically install DKMS modules for new kernels.
### END INIT INFO

test -f /usr/sbin/dkms || exit 0

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
fi

if [ -n "$2" ]; then
    kernel="$2"
else
    kernel=`uname -r`
fi

# See how we were called.
case "$1" in
  start)
    log_daemon_msg "dkms: running auto installation service for kernel $kernel"
    dkms autoinstall --kernelver $kernel
    log_end_msg $?
    ;;
  stop|restart|force-reload|status|reload)
    # ignore
    ;;
  *)
    echo "Usage: $0 {start}"
esac

exit 0