summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts
diff options
context:
space:
mode:
authorIan Reinhart Geiser <igeiser@devonit.com>2013-02-03 14:17:02 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-04 13:18:25 +0000
commit57bbb7d6f4058ac41f37406046e684dfd2bd8ae0 (patch)
treeea5c60f0cc5e8212d4008b43ceb066461bc9057d /meta/recipes-core/initrdscripts
parent60f9aae469ce636ef74837b4496d3ebe7e115d3e (diff)
downloadpoky-57bbb7d6f4058ac41f37406046e684dfd2bd8ae0.tar.gz
initramds-framework: add shutdown hook for udev
In cases where other initramfs modules need to rely on udev running (ie in my case I have to load firmware on a device that is slow to start) there needs to be a way to keep it running during the lifecycle of the initramfs but still be shut down before swith_root is called. I added a module_pre_hook that will shut down udev before the finish module is called. (From OE-Core rev: ce690659ef797bd26dc2be59167aa01744841510) Signed-off-by: Ian Reinhart Geiser <igeiser@devonit.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-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 @@
2# Copyright (C) 2011, 2012 O.S. Systems Software LTDA. 2# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
3# Licensed on MIT 3# Licensed on MIT
4 4
5udev_shutdown_hook_handler() {
6 status=$1
7 module=$2
8 if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
9 killall `basename $_UDEV_DAEMON` 2>/dev/null
10 fi
11}
12
5udev_daemon() { 13udev_daemon() {
6 OPTIONS="/sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd" 14 OPTIONS="/sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
7 15
@@ -27,11 +35,11 @@ udev_enabled() {
27} 35}
28 36
29udev_run() { 37udev_run() {
38 add_module_pre_hook "udev_shutdown_hook_handler"
39
30 mkdir -p /run 40 mkdir -p /run
31 41
32 $_UDEV_DAEMON --daemon 42 $_UDEV_DAEMON --daemon
33 udevadm trigger --action=add 43 udevadm trigger --action=add
34 udevadm settle 44 udevadm settle
35
36 killall `basename $_UDEV_DAEMON` 2>/dev/null
37} 45}