summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/init
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/udev/udev/init')
-rw-r--r--meta/recipes-core/udev/udev/init29
1 files changed, 7 insertions, 22 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index d26cbfca96..ee7967063a 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -20,17 +20,6 @@ SYSCONF_TMP="/dev/shm/udev.cache"
20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf 20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
21[ -f /etc/default/rcS ] && . /etc/default/rcS 21[ -f /etc/default/rcS ] && . /etc/default/rcS
22 22
23readfiles () {
24 READDATA=""
25 for filename in $@; do
26 if [ -r $filename ]; then
27 while read line; do
28 READDATA="$READDATA$line"
29 done < $filename
30 fi
31 done
32}
33
34kill_udevd () { 23kill_udevd () {
35 pid=`pidof -x udevd` 24 pid=`pidof -x udevd`
36 [ -n "$pid" ] && kill $pid 25 [ -n "$pid" ] && kill $pid
@@ -63,14 +52,12 @@ case "$1" in
63 52
64 # Cache handling. 53 # Cache handling.
65 # A list of files which are used as a criteria to judge whether the udev cache could be reused. 54 # A list of files which are used as a criteria to judge whether the udev cache could be reused.
66 CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" 55 CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
56 [ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
67 if [ "$DEVCACHE" != "" ]; then 57 if [ "$DEVCACHE" != "" ]; then
68 if [ -e $DEVCACHE ]; then 58 if [ -e $DEVCACHE ]; then
69 readfiles $CMP_FILE_LIST 59 cat -- "$CMP_FILE_LIST" > "$SYSCONF_TMP"
70 NEWDATA="$READDATA" 60 if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then
71 readfiles "$SYSCONF_CACHED"
72 OLDDATA="$READDATA"
73 if [ "$OLDDATA" = "$NEWDATA" ]; then
74 tar xmf $DEVCACHE -C / -m 61 tar xmf $DEVCACHE -C / -m
75 not_first_boot=1 62 not_first_boot=1
76 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" 63 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
@@ -80,17 +67,15 @@ case "$1" in
80 if [ "$VERBOSE" != "no" ]; then 67 if [ "$VERBOSE" != "no" ]; then
81 echo "udev: udev cache not used" 68 echo "udev: udev cache not used"
82 echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued" 69 echo "udev: we use $CMP_FILE_LIST as criteria to judge whether the cache /dev could be resued"
83 echo "udev: olddata: $OLDDATA" 70 echo "udev: cached sysconf: $SYSCONF_CACHED"
84 echo "udev: newdata: $NEWDATA" 71 echo "udev: current sysconf: $SYSCONF_TMP"
85 fi 72 fi
86 echo "$NEWDATA" > "$SYSCONF_TMP"
87 fi 73 fi
88 else 74 else
89 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then 75 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
90 # If rootfs is not read-only, it's possible that a new udev cache would be generated; 76 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
91 # otherwise, we do not bother to read files. 77 # otherwise, we do not bother to read files.
92 readfiles $CMP_FILE_LIST 78 cat -- "$CMP_FILE_LIST" > "$SYSCONF_TMP"
93 echo "$READDATA" > "$SYSCONF_TMP"
94 fi 79 fi
95 fi 80 fi
96 fi 81 fi