summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@ni.com>2015-04-21 10:35:45 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-28 07:56:55 +0100
commit9686a10207db2354e280c1198080b338ffbd9058 (patch)
treef2a602d5fb65226365005880a88d8d1191dc1237 /meta
parentc62828e0c773d8ab98dfa7a2070bf8cad7b52557 (diff)
downloadpoky-9686a10207db2354e280c1198080b338ffbd9058.tar.gz
udev-cache: improve error handling
If an error occurs while the udev cache is being populated, the system is left in a state where udev is stopped. Remedy this with a clean up function to restart udev and remove any intermediate files. (From OE-Core rev: af911b272ded95884079dc307eeeb1811f0584c9) Signed-off-by: Ken Sharp <ken.sharp@ni.com> Reviewed-by: Ben Shelton <ben.shelton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/udev/udev/udev-cache8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
index 12f68fb825..dcfff1cb45 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -51,9 +51,15 @@ fi
51[ "${VERBOSE}" == "no" ] || echo "found." 51[ "${VERBOSE}" == "no" ] || echo "found."
52echo "Populating dev cache" 52echo "Populating dev cache"
53 53
54err_cleanup () {
55 echo "udev-cache: update failed!"
56 udevadm control --start-exec-queue
57 rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED"
58}
59
54( 60(
55 set -e 61 set -e
56 trap 'echo "udev-cache: update failed!"' EXIT 62 trap 'err_cleanup' EXIT
57 udevadm control --stop-exec-queue 63 udevadm control --stop-exec-queue
58 sysconf_cmd > "$SYSCONF_TMP" 64 sysconf_cmd > "$SYSCONF_TMP"
59 find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ 65 find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \