[oe-commits] Ken Sharp : udev-cache: improve error handling
git at git.openembedded.org
git at git.openembedded.org
Mon Apr 27 14:37:50 UTC 2015
Module: openembedded-core.git
Branch: master-next
Commit: 283486c7254e1e7fc4ffc2645eaafe17aaac69f5
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=283486c7254e1e7fc4ffc2645eaafe17aaac69f5
Author: Ken Sharp <ken.sharp at ni.com>
Date: Tue Apr 21 10:35:45 2015 -0500
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.
Signed-off-by: Ken Sharp <ken.sharp at ni.com>
Reviewed-by: Ben Shelton <ben.shelton at ni.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-core/udev/udev/udev-cache | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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- \
More information about the Openembedded-commits
mailing list