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/init15
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index 337b6d4c11..96578bc15b 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -17,6 +17,16 @@ export TZ=/etc/localtime
17SYSCONF_CACHED="/etc/udev/cache.data" 17SYSCONF_CACHED="/etc/udev/cache.data"
18SYSCONF_TMP="/dev/shm/udev.cache" 18SYSCONF_TMP="/dev/shm/udev.cache"
19DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen 19DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
20
21# A list of files which are used as a criteria to judge whether the udev cache could be reused.
22CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
23[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
24
25# Command to compute system configuration.
26sysconf_cmd () {
27 cat -- $CMP_FILE_LIST
28}
29
20[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 30[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
21[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf 31[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
22[ -f /etc/default/rcS ] && . /etc/default/rcS 32[ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -52,12 +62,9 @@ case "$1" in
52 mkdir -m 1777 -p /var/volatile/tmp 62 mkdir -m 1777 -p /var/volatile/tmp
53 63
54 # Cache handling. 64 # Cache handling.
55 # A list of files which are used as a criteria to judge whether the udev cache could be reused.
56 CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
57 [ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
58 if [ "$DEVCACHE" != "" ]; then 65 if [ "$DEVCACHE" != "" ]; then
59 if [ -e $DEVCACHE ]; then 66 if [ -e $DEVCACHE ]; then
60 cat -- "$CMP_FILE_LIST" > "$SYSCONF_TMP" 67 sysconf_cmd > "$SYSCONF_TMP"
61 if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then 68 if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then
62 tar xmf $DEVCACHE -C / -m 69 tar xmf $DEVCACHE -C / -m
63 not_first_boot=1 70 not_first_boot=1