summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/init
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-12-20 13:19:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-03 12:14:27 +0000
commite412dbf6cd67702bb50126a0f5ab9aecbe9c90bf (patch)
treeab1edacb91a0d7ffcee38a146bf964b88dbc5f4b /meta/recipes-core/udev/udev/init
parent005b67f2824aeb207bef0c054d8ffa38d94ae87e (diff)
downloadpoky-e412dbf6cd67702bb50126a0f5ab9aecbe9c90bf.tar.gz
udev: reorganize files of 164 version
We merged both files and udev-164 directory onto a single directory and renamed udev-new.inc onto udev.inc as we have a single version of udev now. (From OE-Core rev: abde2a045a39a70a6247a7ae591a131120ab8ed3) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/udev/udev/init')
-rw-r--r--meta/recipes-core/udev/udev/init59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
new file mode 100644
index 0000000000..073942f27e
--- /dev/null
+++ b/meta/recipes-core/udev/udev/init
@@ -0,0 +1,59 @@
1#!/bin/sh -e
2
3### BEGIN INIT INFO
4# Provides: udev
5# Required-Start: mountvirtfs
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Start udevd, populate /dev and load drivers.
10### END INIT INFO
11
12export TZ=/etc/localtime
13
14[ -d /sys/class ] || exit 1
15[ -r /proc/mounts ] || exit 1
16[ -x /sbin/udevd ] || exit 1
17[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
18
19kill_udevd() {
20 if [ -x /sbin/pidof ]; then
21 pid=`/sbin/pidof -x udevd`
22 [ -n "$pid" ] && kill $pid
23 fi
24}
25
26export ACTION=add
27# propagate /dev from /sys
28echo -n "Starting udev"
29
30# mount the tmpfs on /dev, if not already done
31LANG=C awk "\$2 == \"/dev\" && \$4 == \"tmpfs\" { exit 1 }" /proc/mounts && {
32 mount -n -o mode=0755 -t tmpfs none "/dev"
33 mkdir -m 0755 /dev/pts
34 mkdir -m 1777 /dev/shm
35}
36
37if [ -e /etc/dev.tar ]; then
38 (cd /; tar xf /etc/dev.tar 2>&1 | grep -v 'time stamp' || true)
39 not_first_boot=1
40fi
41
42# make_extra_nodes
43kill_udevd > "/dev/null" 2>&1
44
45 # trigger the sorted events
46 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
47 /sbin/udevd -d
48
49 /sbin/udevadm control --env=STARTUP=1
50 if [ "$not_first_boot" != "" ];then
51 /sbin/udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
52 (/sbin/udevadm settle --timeout=3; /sbin/udevadm control --env=STARTUP=)&
53 else
54 /sbin/udevadm trigger --action=add
55 /sbin/udevadm settle
56 fi
57
58echo
59exit 0