summaryrefslogtreecommitdiff
path: root/meta/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/udev12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev
index 7fbcc61d9c..50c934993d 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/udev
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -2,6 +2,14 @@
# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
# Licensed on MIT
+udev_shutdown_hook_handler() {
+ status=$1
+ module=$2
+ if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
+ killall `basename $_UDEV_DAEMON` 2>/dev/null
+ fi
+}
+
udev_daemon() {
OPTIONS="/sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
@@ -27,11 +35,11 @@ udev_enabled() {
}
udev_run() {
+ add_module_pre_hook "udev_shutdown_hook_handler"
+
mkdir -p /run
$_UDEV_DAEMON --daemon
udevadm trigger --action=add
udevadm settle
-
- killall `basename $_UDEV_DAEMON` 2>/dev/null
}