diff options
Diffstat (limited to 'meta/recipes-core/udev/udev/init')
-rw-r--r-- | meta/recipes-core/udev/udev/init | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init index 6a4464c639..78b5b1c4b6 100644 --- a/meta/recipes-core/udev/udev/init +++ b/meta/recipes-core/udev/udev/init | |||
@@ -14,8 +14,19 @@ export TZ=/etc/localtime | |||
14 | [ -d /sys/class ] || exit 1 | 14 | [ -d /sys/class ] || exit 1 |
15 | [ -r /proc/mounts ] || exit 1 | 15 | [ -r /proc/mounts ] || exit 1 |
16 | [ -x /sbin/udevd ] || exit 1 | 16 | [ -x /sbin/udevd ] || exit 1 |
17 | [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache | ||
17 | [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf | 18 | [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf |
18 | 19 | ||
20 | readfile () { | ||
21 | filename=$1 | ||
22 | READDATA="" | ||
23 | if [ -r $filename ]; then | ||
24 | while read line; do | ||
25 | READDATA="$READDATA$line" | ||
26 | done < $filename | ||
27 | fi | ||
28 | } | ||
29 | |||
19 | kill_udevd() { | 30 | kill_udevd() { |
20 | if [ -x /sbin/pidof ]; then | 31 | if [ -x /sbin/pidof ]; then |
21 | pid=`/sbin/pidof -x udevd` | 32 | pid=`/sbin/pidof -x udevd` |
@@ -34,10 +45,26 @@ LANG=C awk '$2 == "/dev" && ($3 == "tmpfs" || $3 == "devtmpfs") { exit 1 }' /pro | |||
34 | [ -e /dev/pts ] || mkdir -m 0755 /dev/pts | 45 | [ -e /dev/pts ] || mkdir -m 0755 /dev/pts |
35 | [ -e /dev/shm ] || mkdir -m 1777 /dev/shm | 46 | [ -e /dev/shm ] || mkdir -m 1777 /dev/shm |
36 | 47 | ||
48 | # cache handling | ||
49 | if [ "$DEVCACHE" != "" ]; then | ||
50 | readfile /proc/version | ||
51 | VERSION="$READDATA" | ||
52 | readfile /proc/cmdline | ||
53 | CMDLINE="$READDATA" | ||
54 | readfile /proc/devices | ||
55 | DEVICES="$READDATA" | ||
56 | readfile /proc/atags | ||
57 | ATAGS="$READDATA" | ||
37 | 58 | ||
38 | if [ -e /etc/dev.tar ]; then | 59 | if [ -e $DEVCACHE ]; then |
39 | (cd /; tar xf /etc/dev.tar 2>&1 | grep -v 'time stamp' || true) | 60 | readfile /etc/udev/cache.data |
40 | not_first_boot=1 | 61 | if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then |
62 | (cd /; tar xf $DEVCACHE > /dev/null 2>&1) | ||
63 | not_first_boot=1 | ||
64 | fi | ||
65 | |||
66 | echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache | ||
67 | fi | ||
41 | fi | 68 | fi |
42 | 69 | ||
43 | # make_extra_nodes | 70 | # make_extra_nodes |