diff options
Diffstat (limited to 'meta/recipes-core/udev/udev/udev-cache')
-rw-r--r-- | meta/recipes-core/udev/udev/udev-cache | 17 |
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" SYSCONF_TMP="/dev/shm/udev.cache" # A list of files which are used as a criteria to judge whether the udev cache could be reused. -CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices /proc/atags" +CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" +[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags" [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache -readfiles () { - READDATA="" - for filename in $@; do - if [ -r $filename ]; then - while read line; do - READDATA="$READDATA$line" - done < $filename - fi - done -} - if [ "$ROOTFS_READ_ONLY" = "yes" ]; then [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" exit 0 @@ -43,8 +33,7 @@ fi if [ "$DEVCACHE" != "" -a -e "$SYSCONF_TMP" ]; then echo "Populating dev cache" udevadm control --stop-exec-queue - readfiles $CMP_FILE_LIST - echo "$READDATA" > "$SYSCONF_TMP" + cat -- $CMP_FILE_LIST > "$SYSCONF_TMP" find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ | xargs tar cf "${DEVCACHE_TMP}" -T- gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" |