summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/init
diff options
context:
space:
mode:
authorRichard Tollerton <rich.tollerton@ni.com>2014-08-22 16:30:54 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-23 23:01:59 +0100
commitfd0aa6af628247d41fc61ba84be748f2f4fc2a72 (patch)
tree5798c32406ed771ed9d6d85fe64c476032b9a0b5 /meta/recipes-core/udev/udev/init
parent7c56a5e728f4c5adb3c9df7cf3cb2da782e3c94c (diff)
downloadpoky-fd0aa6af628247d41fc61ba84be748f2f4fc2a72.tar.gz
udev-cache: parametrize sysconf file paths
The udev-cache facility uses files that represent system states, to ensure that the cache tarball is valid to apply. These paths were hardcoded in several places; collect them into SYSCONF_CACHED and SYSCONF_TMP. (From OE-Core rev: f4fcb237da0d1013005e9a0bb2381cfeb4c5316c) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> 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/init10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index ce0a68c0fc..96bd774d24 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -14,6 +14,8 @@ 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 @UDEVD@ ] || exit 1 16[ -x @UDEVD@ ] || exit 1
17SYSCONF_CACHED="/etc/udev/cache.data"
18SYSCONF_TMP="/dev/shm/udev.cache"
17[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
18[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf 20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
19[ -f /etc/default/rcS ] && . /etc/default/rcS 21[ -f /etc/default/rcS ] && . /etc/default/rcS
@@ -66,13 +68,13 @@ case "$1" in
66 if [ -e $DEVCACHE ]; then 68 if [ -e $DEVCACHE ]; then
67 readfiles $CMP_FILE_LIST 69 readfiles $CMP_FILE_LIST
68 NEWDATA="$READDATA" 70 NEWDATA="$READDATA"
69 readfiles /etc/udev/cache.data 71 readfiles "$SYSCONF_CACHED"
70 OLDDATA="$READDATA" 72 OLDDATA="$READDATA"
71 if [ "$OLDDATA" = "$NEWDATA" ]; then 73 if [ "$OLDDATA" = "$NEWDATA" ]; then
72 tar xmf $DEVCACHE -C / -m 74 tar xmf $DEVCACHE -C / -m
73 not_first_boot=1 75 not_first_boot=1
74 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" 76 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
75 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache 77 [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP"
76 else 78 else
77 # Output detailed reason why the cached /dev is not used 79 # Output detailed reason why the cached /dev is not used
78 if [ "$VERBOSE" != "no" ]; then 80 if [ "$VERBOSE" != "no" ]; then
@@ -81,14 +83,14 @@ case "$1" in
81 echo "udev: olddata: $OLDDATA" 83 echo "udev: olddata: $OLDDATA"
82 echo "udev: newdata: $NEWDATA" 84 echo "udev: newdata: $NEWDATA"
83 fi 85 fi
84 echo "$NEWDATA" > /dev/shm/udev.cache 86 echo "$NEWDATA" > "$SYSCONF_TMP"
85 fi 87 fi
86 else 88 else
87 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then 89 if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
88 # If rootfs is not read-only, it's possible that a new udev cache would be generated; 90 # If rootfs is not read-only, it's possible that a new udev cache would be generated;
89 # otherwise, we do not bother to read files. 91 # otherwise, we do not bother to read files.
90 readfiles $CMP_FILE_LIST 92 readfiles $CMP_FILE_LIST
91 echo "$READDATA" > /dev/shm/udev.cache 93 echo "$READDATA" > "$SYSCONF_TMP"
92 fi 94 fi
93 fi 95 fi
94 fi 96 fi