diff options
| -rw-r--r-- | meta/recipes-core/udev/udev/udev-cache | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache index 3c18061991..895b1971c4 100644 --- a/meta/recipes-core/udev/udev/udev-cache +++ b/meta/recipes-core/udev/udev/udev-cache | |||
| @@ -42,19 +42,28 @@ if [ "$ROOTFS_READ_ONLY" = "yes" ]; then | |||
| 42 | exit 0 | 42 | exit 0 |
| 43 | fi | 43 | fi |
| 44 | 44 | ||
| 45 | if [ "$DEVCACHE" != "" -a -e "$DEVCACHE_REGEN" ]; then | 45 | [ "$DEVCACHE" != "" ] || exit 0 |
| 46 | echo "Populating dev cache" | 46 | [ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... " |
| 47 | ( | 47 | if ! [ -e "$DEVCACHE_REGEN" ]; then |
| 48 | udevadm control --stop-exec-queue | 48 | [ "${VERBOSE}" == "no" ] || echo "not found." |
| 49 | sysconf_cmd > "$SYSCONF_TMP" | 49 | exit 0 |
| 50 | find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ | ||
| 51 | | xargs tar cf "${DEVCACHE_TMP}" -T- | ||
| 52 | gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" | ||
| 53 | rm -f "${DEVCACHE_TMP}" | ||
| 54 | mv "$SYSCONF_TMP" "$SYSCONF_CACHED" | ||
| 55 | udevadm control --start-exec-queue | ||
| 56 | rm -f "$DEVCACHE_REGEN" | ||
| 57 | ) & | ||
| 58 | fi | 50 | fi |
| 51 | [ "${VERBOSE}" == "no" ] || echo "found." | ||
| 52 | echo "Populating dev cache" | ||
| 53 | |||
| 54 | ( | ||
| 55 | set -e | ||
| 56 | trap 'echo "udev-cache: update failed!"' EXIT | ||
| 57 | udevadm control --stop-exec-queue | ||
| 58 | sysconf_cmd > "$SYSCONF_TMP" | ||
| 59 | find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ | ||
| 60 | | xargs tar cf "${DEVCACHE_TMP}" -T- | ||
| 61 | gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" | ||
| 62 | rm -f "${DEVCACHE_TMP}" | ||
| 63 | mv "$SYSCONF_TMP" "$SYSCONF_CACHED" | ||
| 64 | udevadm control --start-exec-queue | ||
| 65 | rm -f "$DEVCACHE_REGEN" | ||
| 66 | trap - EXIT | ||
| 67 | ) & | ||
| 59 | 68 | ||
| 60 | exit 0 | 69 | exit 0 |
