summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/udev-cache
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/udev/udev/udev-cache')
-rw-r--r--meta/recipes-core/udev/udev/udev-cache17
1 files changed, 3 insertions, 14 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index a1410f5579..e0e1c39488 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -21,20 +21,10 @@ SYSCONF_CACHED="/etc/udev/cache.data"
21SYSCONF_TMP="/dev/shm/udev.cache" 21SYSCONF_TMP="/dev/shm/udev.cache"
22 22
23# A list of files which are used as a criteria to judge whether the udev cache could be reused. 23# A list of files which are used as a criteria to judge whether the udev cache could be reused.
24CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" 24CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
25[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
25[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache 26[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
26 27
27readfiles () {
28 READDATA=""
29 for filename in $@; do
30 if [ -r $filename ]; then
31 while read line; do
32 READDATA="$READDATA$line"
33 done < $filename
34 fi
35 done
36}
37
38if [ "$ROOTFS_READ_ONLY" = "yes" ]; then 28if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
39 [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" 29 [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
40 exit 0 30 exit 0
@@ -43,8 +33,7 @@ fi
43if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then 33if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then
44 echo "Populating dev cache" 34 echo "Populating dev cache"
45 udevadm control --stop-exec-queue 35 udevadm control --stop-exec-queue
46 readfiles $CMP_FILE_LIST 36 cat -- $CMP_FILE_LIST > "$SYSCONF_TMP"
47 echo "$READDATA" > "$SYSCONF_TMP"
48 find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ 37 find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
49 | xargs tar cf "${DEVCACHE_TMP}" -T- 38 | xargs tar cf "${DEVCACHE_TMP}" -T-
50 gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" 39 gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"