summaryrefslogtreecommitdiffstats
path: root/smgl/init.d/init.d/devices
blob: 478c43ddbc9224c45fa39e0caffbd132ff340def (plain) (blame)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

PROGRAM=/bin/false
RUNLEVEL=DEV
ESSENTIAL=yes

. /etc/init.d/smgl_init
. /etc/sysconfig/devices

udev_mknodes()
{
  mkdir $udev_root/shm
  mkdir $udev_root/pts
}

start_udev()
{ (
  . /etc/udev/udev.conf
  echo "Checking if devtmpfs or ramfs is used for $udev_root ..."
  if findmnt devtmpfs > /dev/null 2>&1; then
    echo "devtmpfs is used for $udev_root"
  else
    echo "ramfs is used for $udev_root"
    echo "Mounting ramfs at $udev_root"
    mount -n -t ramfs none $udev_root
  fi
  # create some needed stuff
  udev_mknodes
) }

start_static_udev()
{ (
  . /etc/udev/udev.conf
  # create some needed stuff - and insist on it
  udev_mknodes

) }

start_static()
{
   exit 0
}

start()
{
  # mount proc
  echo "Mounting /proc"
  mount -n -t proc proc /proc
  # mount sys
  echo "Mounting /sys"
  mount -n -t sysfs sysfs /sys
  # mount run
  echo "Mounting /run"
  mount -n -o size=${RUN_SIZE:-50%} -t tmpfs tmpfs /run
  eval "start_$DEVICES"
}

stop() { exit 0; }
restart() { exit 3; }
reload() { exit 3; }
force_reload() { exit 3; }
status() { exit 3; }

usage()
{
  echo "Usage: $0 {start|stop}"
  echo "Warning: Do not run this script manually!"
}