From 370c2513914076e0815f8e36bcd200ca740a1163 Mon Sep 17 00:00:00 2001 From: John Klug Date: Thu, 22 Mar 2018 12:18:40 -0500 Subject: pgrep does not work during boot causing gpsd_ubx_* commands to hang. --- recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh | 5 ++++- recipes-navigation/gpsd/gpsd/gpsd_ubx_settime.sh | 5 ++++- recipes-navigation/gpsd/gpsd_3.16.bb | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh b/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh index 6c9c126..a1b59cf 100755 --- a/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh +++ b/recipes-navigation/gpsd/gpsd/gpsd_ubx_fixed.sh @@ -59,7 +59,10 @@ fi ps -fjp $ppid | LG -p user.error fi - gpsmonpid=$(pgrep -lg $pgid | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//') + # pgrep does not work during boot. + pgrpmemb=$(ps --no-heading -o pgid,pid,comm -e | grep '^ *'"${pgid}"' *' | sed -r 's/^ *[0-9]+ *//') + gpsmonpid=$(echo "${pgrpmemb}" | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//') + ((DEBUG)) && LG -p user.info "$pgid is pgid $gpsmonpid is gpsmonpid" # Find the gpsmonpid that is our grandchild ((didkill=0)) diff --git a/recipes-navigation/gpsd/gpsd/gpsd_ubx_settime.sh b/recipes-navigation/gpsd/gpsd/gpsd_ubx_settime.sh index f74e7b0..15dc9c7 100755 --- a/recipes-navigation/gpsd/gpsd/gpsd_ubx_settime.sh +++ b/recipes-navigation/gpsd/gpsd/gpsd_ubx_settime.sh @@ -38,7 +38,10 @@ fi ps -fjp $ppid | LG -p user.error fi - gpsmonpid=$(pgrep -lg $pgid | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//') + # pgrep does not work during boot. + pgrpmemb=$(ps --no-heading -o pgid,pid,comm -e | grep '^ *'"${pgid}"' *' | sed -r 's/^ *[0-9]+ *//') + gpsmonpid=$(echo "${pgrpmemb}" | egrep '[[:space:]]gpsmon$' | sed 's/[[:space:]].*//') + ((DEBUG)) && LG -p user.info "$pgid is pgid $gpsmonpid is gpsmonpid" # Find the gpsmonpid that is our grandchild ((didkill=0)) diff --git a/recipes-navigation/gpsd/gpsd_3.16.bb b/recipes-navigation/gpsd/gpsd_3.16.bb index 4e650dc..68d54ff 100644 --- a/recipes-navigation/gpsd/gpsd_3.16.bb +++ b/recipes-navigation/gpsd/gpsd_3.16.bb @@ -4,7 +4,7 @@ LICENSE = "BSD" LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-replacement-native pps-tools" PROVIDES = "virtual/gpsd" -PR="m4" +PR="m7" EXTRANATIVEPATH += "chrpath-native" -- cgit v1.2.3