summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@ni.com>2015-04-21 15:35:45 (GMT)
committerJoshua Lock <joshua.lock@collabora.co.uk>2015-04-28 09:07:04 (GMT)
commitcbea9b68dbf4fce3efae055dd79deb932329012e (patch)
treee5cf02ba788d4db8434ed8dff3c09c40a0983ada
parent526f8d9ee1b0f215b4480e60d14b0ad6ed4525bd (diff)
downloadopenembedded-core-cbea9b68dbf4fce3efae055dd79deb932329012e.tar.gz
openembedded-core-cbea9b68dbf4fce3efae055dd79deb932329012e.tar.xz
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 master 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>
-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 12f68fb..dcfff1c 100644
--- a/meta/recipes-core/udev/udev/udev-cache
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -51,9 +51,15 @@ fi
[ "${VERBOSE}" == "no" ] || echo "found."
echo "Populating dev cache"
+err_cleanup () {
+ echo "udev-cache: update failed!"
+ udevadm control --start-exec-queue
+ rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED"
+}
+
(
set -e
- trap 'echo "udev-cache: update failed!"' EXIT
+ trap 'err_cleanup' EXIT
udevadm control --stop-exec-queue
sysconf_cmd > "$SYSCONF_TMP"
find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \