diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2012-11-27 11:55:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-12-13 15:21:41 +0000 |
commit | 3dc7f6d05e52ccbe2fea0cc2d23ff6e6fc93232b (patch) | |
tree | 5888678147965bbe0e733af6e9f4ef7e48f4ce20 | |
parent | 0140519ba15bfb27ccbfb3d41c7e678a1118fc5c (diff) | |
download | poky-3dc7f6d05e52ccbe2fea0cc2d23ff6e6fc93232b.tar.gz |
initramfs-framework: udev: Handle alternative binary paths
This allows use of udev daemon for different installation destinations
so allowing use of udev's from systemd code for initramfs.
(From OE-Core rev: dcf95bed1d9152d9cdb908b4e131e1c7c46cec84)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-framework/udev | 25 | ||||
-rw-r--r-- | meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb | 2 |
2 files changed, 21 insertions, 6 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev index 15a1d5ba06..7fbcc61d9c 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/udev +++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev | |||
@@ -1,10 +1,25 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # Copyright (C) 2011 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 | ||
5 | udev_daemon() { | ||
6 | OPTIONS="/sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd" | ||
7 | |||
8 | for o in $OPTIONS; do | ||
9 | if [ -x "$o" ]; then | ||
10 | echo $o | ||
11 | return 0 | ||
12 | fi | ||
13 | done | ||
14 | |||
15 | return 1 | ||
16 | } | ||
17 | |||
18 | _UDEV_DAEMON=`udev_daemon` | ||
19 | |||
5 | udev_enabled() { | 20 | udev_enabled() { |
6 | if [ ! -e /lib/udev/udevd ]; then | 21 | if [ -z "$_UDEV_DAEMON" ]; then |
7 | debug "/lib/udev/udev doesn't exist" | 22 | msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs." |
8 | return 1 | 23 | return 1 |
9 | fi | 24 | fi |
10 | 25 | ||
@@ -14,9 +29,9 @@ udev_enabled() { | |||
14 | udev_run() { | 29 | udev_run() { |
15 | mkdir -p /run | 30 | mkdir -p /run |
16 | 31 | ||
17 | /lib/udev/udevd --daemon > /dev/null | 32 | $_UDEV_DAEMON --daemon |
18 | udevadm trigger --action=add | 33 | udevadm trigger --action=add |
19 | udevadm settle | 34 | udevadm settle |
20 | 35 | ||
21 | killall udevd 2>/dev/null | 36 | killall `basename $_UDEV_DAEMON` 2>/dev/null |
22 | } | 37 | } |
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb index 45d6592bc3..cbb4a39611 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb | |||
@@ -3,7 +3,7 @@ LICENSE = "MIT" | |||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
4 | RDEPENDS = "busybox" | 4 | RDEPENDS = "busybox" |
5 | 5 | ||
6 | PR = "r1" | 6 | PR = "r2" |
7 | 7 | ||
8 | inherit allarch | 8 | inherit allarch |
9 | 9 | ||