Patchwork [3/9] udev: remove implicit dependency on initscripts

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 26, 2013, 7:39 a.m.
Message ID <d8a3e07546df15c56fc82119c1f0dbb98812e492.1374642547.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/54551/
State Accepted
Commit 11660bc1c638a5b76c7d83010a61f1b59e9379e1
Headers show

Comments

Qi.Chen@windriver.com - July 26, 2013, 7:39 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

At some point, the udev was modified to source the functions from
initscripts or lsbinitscripts. This dependency is actually not needed.
If we use udev in a system where initscripts from oe-core is not available,
there will be errors.

This patch fixes this problem by removing the implicit dependency.

[YOCTO #4882]
[YOCTO #4103]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/udev/udev/init |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
index 4e5094a..52c7925 100644
--- a/meta/recipes-core/udev/udev/init
+++ b/meta/recipes-core/udev/udev/init
@@ -9,8 +9,6 @@ 
 # Short-Description: Start udevd, populate /dev and load drivers.
 ### END INIT INFO
 
-. /etc/init.d/functions
-
 export TZ=/etc/localtime
 
 [ -d /sys/class ] || exit 1
@@ -31,6 +29,11 @@  readfiles () {
    done
 }
 
+kill_udevd () {
+    pid=`pidof -x udevd`
+    [ -n "$pid" ] && kill $pid
+}
+
 case "$1" in
   start)
     export ACTION=add
@@ -94,7 +97,7 @@  case "$1" in
     fi
 
     # make_extra_nodes
-    killproc udevd > "/dev/null" 2>&1
+    kill_udevd > "/dev/null" 2>&1
 
     # trigger the sorted events
     echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
@@ -119,7 +122,12 @@  case "$1" in
     $0 start
     ;;
   status)
-    status udevd
+    pid=`pidof -x udevd`
+    if [ -n "$pid" ]; then
+	echo "udevd (pid $pid) is running ..."
+    else
+	echo "udevd is stopped"
+    fi
     ;;
   *)
     echo "Usage: $0 {start|stop|status|restart}"