All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-devel@lists.linuxtogo.org
Subject: [meta-handheld][PATCH] zaurusd: remove dependency on procps
Date: Sun, 12 Aug 2012 13:16:23 +0100	[thread overview]
Message-ID: <1344773783-17934-1-git-send-email-paul.eggleton@linux.intel.com> (raw)

With a little tweaking we don't need procps; we can rely on what busybox
provides. If nothing else requires procps this saves some space on the
target.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 recipes-bsp/zaurusd/zaurusd/scripts_pidof.patch    |   33 ++++++++++++++++++++
 recipes-bsp/zaurusd/zaurusd/zaurus-hinge.in        |   11 ++++---
 .../zaurusd/zaurusd/zaurus-hinge.matchbox-portrait |    4 +--
 recipes-bsp/zaurusd/zaurusd_git.bb                 |    4 +--
 4 files changed, 43 insertions(+), 9 deletions(-)
 create mode 100644 recipes-bsp/zaurusd/zaurusd/scripts_pidof.patch

diff --git a/recipes-bsp/zaurusd/zaurusd/scripts_pidof.patch b/recipes-bsp/zaurusd/zaurusd/scripts_pidof.patch
new file mode 100644
index 0000000..9eed68f
--- /dev/null
+++ b/recipes-bsp/zaurusd/zaurusd/scripts_pidof.patch
@@ -0,0 +1,33 @@
+From f271fa43ec63ed5650296a393403318ab0e553d4 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Sun, 5 Aug 2012 01:41:16 +0100
+Subject: [PATCH] scripts/zaurusd: use pidof instead of mangling output of ps
+
+busybox provides working pidof if sysvinit doesn't, so use that.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ scripts/zaurusd.in |    5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/zaurusd.in b/scripts/zaurusd.in
+index ad896aa..acb5158 100755
+--- a/scripts/zaurusd.in
++++ b/scripts/zaurusd.in
+@@ -1,10 +1,7 @@
+ #!/bin/sh
+ 
+ killproc() {            # kill the named process(es)
+-        pid=`/bin/ps -e x |
+-             /bin/grep $1 |
+-             /bin/grep -v grep |
+-             /bin/sed -e 's/^  *//' -e 's/ .*//'`
++        pid=`/bin/pidof $1`
+         [ "$pid" != "" ] && kill $pid
+ }
+ 
+-- 
+1.7.1
+
diff --git a/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.in b/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.in
index 0fcad38..660e6cc 100644
--- a/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.in
+++ b/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.in
@@ -4,10 +4,7 @@
 #
 
 killproc() {            # kill the named process(es)
-        pid=`/bin/ps -e x |
-             /bin/grep $1 |
-             /bin/grep -v grep |
-             /bin/sed -e 's/^  *//' -e 's/ .*//'`
+        pid=`/bin/pidof $1`
         [ "$pid" != "" ] && kill $pid
 }
 
@@ -19,7 +16,11 @@ if [ -z "$1" ]; then
    exit 1
 fi
 
-panel_user="`ps aux|grep matchbox-panel|grep -v grep | awk '{print $1}'`"
+if [ ps aux > /dev/null 2>&1 ] ; then
+	panel_user="`ps aux|grep matchbox-panel|grep -v grep | awk '{print $1}'`"
+else
+	panel_user="`ps|grep matchbox-panel|grep -v grep | awk '{print $2}'`"
+fi
 
 STATE=$1
 
diff --git a/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.matchbox-portrait b/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.matchbox-portrait
index e540e66..bce305d 100644
--- a/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.matchbox-portrait
+++ b/recipes-bsp/zaurusd/zaurusd/zaurus-hinge.matchbox-portrait
@@ -21,9 +21,9 @@
   if test -n "$panel_user"
   then
     echo "Running panel as user [$panel_user]"
-    ps aux | grep "$panel_user" | grep -q "mbinputmgr " || su $panel_user -c ${ZD_BINDIR}/mbinputmgr &
+    ps aux 2>/dev/null || ps | grep "$panel_user" | grep -q "mbinputmgr " || su $panel_user -c ${ZD_BINDIR}/mbinputmgr &
   else
      # A failsafe can't hurt
      echo "Warning: Running mbinputmgr as root!"
-     ps aux | grep -q "mbinputmgr " || ${ZD_BINDIR}/mbinputmgr &
+     ps aux 2>/dev/null || ps | grep -q "mbinputmgr " || ${ZD_BINDIR}/mbinputmgr &
   fi
diff --git a/recipes-bsp/zaurusd/zaurusd_git.bb b/recipes-bsp/zaurusd/zaurusd_git.bb
index db24c7b..821dbec 100644
--- a/recipes-bsp/zaurusd/zaurusd_git.bb
+++ b/recipes-bsp/zaurusd/zaurusd_git.bb
@@ -6,7 +6,7 @@ DEPENDS = "tslib"
 
 PE = "1"
 PV = "0.0+gitr${SRCPV}"
-PR = "r25"
+PR = "r26"
 
 SRCREV = "82b30c7865f007fff81372c3cdc71b2ff6843ccc"
 SRC_URI = "git://git.yoctoproject.org/zaurusd;protocol=git \
@@ -17,6 +17,7 @@ SRC_URI = "git://git.yoctoproject.org/zaurusd;protocol=git \
 	   file://disable-alsa-handling.patch \
 	   file://avoid-rotated-server.patch \
 	   file://new-make.patch \
+	   file://scripts_pidof.patch \
 	   file://zaurus-hinge.matchbox-portrait \
 	   file://zaurus-hinge.matchbox-landscape \
 	   file://zaurus-hinge.bl-on \
@@ -57,6 +58,5 @@ inherit autotools pkgconfig update-rc.d
 INITSCRIPT_NAME = "zaurusd"
 INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
 
-RDEPENDS_${PN} = "procps"
 RRECOMMENDS_${PN} += "kernel-module-uinput"
 
-- 
1.7.9.5




                 reply	other threads:[~2012-08-12 12:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344773783-17934-1-git-send-email-paul.eggleton@linux.intel.com \
    --to=paul.eggleton@linux.intel.com \
    --cc=openembedded-devel@lists.linuxtogo.org \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.