forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-02-17 557c24d082b6ecb9bfe5407b77ae43fa7650a5dc
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
#!/bin/sh
#
# Run the mdev daemon
#
 
DAEMON="mdev"
PIDFILE="/var/run/$DAEMON.pid"
 
 
start() {
  echo -n "Starting $DAEMON... "
  start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df
  [ $? -eq 0 ] && echo "OK" || echo "ERROR"
 
  # coldplug modules
  find /sys/ -name modalias -print0 | \
    xargs -0 sort -u | \
    tr '\n' '\0' | \
    xargs -0 modprobe -abq
}
 
stop() {
  echo -n "Stopping $DAEMON... "
  start-stop-daemon -K -p $PIDFILE
  [ $? -eq 0 ] && echo "OK" || echo "ERROR"
}
 
restart() {
  stop
  start
}
 
case "$1" in
  start|stop|restart)
  "$1"
  ;;
  *)
  echo "Usage: $0 {start|stop|restart}"
  exit 1
esac
 
exit $?