Skip to contentSkip to conversation

org.oe.dev gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

oe-commits Paul Sokolovsky 3 participants 8 messages Jan 1, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello,

      Working default configuration should go to ${PN}-conf or

something, like most of OE does, and few remaining uncomplying packages are being converted. This helps with build, QA, and release management. Thanks.

This is a forwarded message
From: coredump2 commit <[email protected]>
To: [email protected]
Date: Tuesday, January 1, 2008, 6:29:57 PM
Subject: [oe-commits] org.oe.dev gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

===8<==============Original message text===============
gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

Author: [email protected]
Branch: org.openembedded.dev
Revision: bc99dc2db85d728b06d198abe611e989797af107
ViewMTN: http://monotone.openembedded.org/revision/info/bc99dc2db85d728b06d198abe611e989797af107
Files:
1
packages/gpsd/files/fic-gta01
packages/gpsd/files/fic-gta01/gpsd
packages/gpsd/files/fic-gta01/gpsd-default
packages/gpsd/gpsd_2.34.bb
mtn:execute
true
Diffs:

#

# mt diff -r501fa938422c98da06cd4133211f6e771f97716f -rbc99dc2db85d728b06d198abe611e989797af107
#
# 
# 
# add_dir "packages/gpsd/files/fic-gta01"
# 
# add_file "packages/gpsd/files/fic-gta01/gpsd"
#  content [30f3c12ba74fb70a443b725f2bb81760e8c6b8d8]
# 
# add_file "packages/gpsd/files/fic-gta01/gpsd-default"
#  content [c45e36caad5bdf37b7d5defe8f18d431e25f9bd4]
# 
# patch "packages/gpsd/gpsd_2.34.bb"
#  from [4ea8e37b9fbdf1a614c46bcd12247dffa2d96067]
#    to [8e241bbd828101019cda7b30a6725fd6759f50f4]
# 
#   set "packages/gpsd/files/fic-gta01/gpsd"
#  attr "mtn:execute"
# value "true"
# 
============================================================
--- packages/gpsd/files/fic-gta01/gpsd  30f3c12ba74fb70a443b725f2bb81760e8c6b8d8
+++ packages/gpsd/files/fic-gta01/gpsd  30f3c12ba74fb70a443b725f2bb81760e8c6b8d8
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# gpsd	This shell script starts and stops gpsd.
+#
+# chkconfig: 345 90 40
+# description: Gpsd manages access to a serial- or USB-connected GPS
+# processname: gpsd
+
+# Source function library.
+#. /etc/rc.d/init.d/functions
+
+RETVAL=0
+prog="gpsd"
+
+test -f /etc/default/$prog && . /etc/default/$prog
+
+start() {
+       # Start daemons.
+       echo -n "Starting $prog: "
+       # We don't use the daemon function here because of a known bug
+       # in initlog -- it spuriously returns a nonzero status when 
+       # starting daemons that fork themselves.  See
+       # http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130629
+       # for discussion.  Fortunately:
+       #
+       # 1. gpsd startup can't fail, or at least not in the absence of
+       # much larger resource-exhaustion problems that would be very obvious.
+       #
+       # 2. We don't need all the logging crud that daemon/initlog sets
+       # up -- gpsd does its own syslog calls.
+       #
+       
+       if test -e /home/root/gllin/gllin
+       then
+               /home/root/gllin/gllin >/var/log/gllin.log 2>&1 &
+       else
+               echo -e "\n\ngllin GPS driver for Neo1973 not found,"
+               echo "please install the gllin package from"
+               echo "http://3rdparty.downloads.openmoko.org/gllin/"
+               echo ""
+               exit 1
+       fi
+       
+       if [ -e "${GPS_DEV}" ]
+       then
+           gpsd ${GPSD_OPTS} -p ${GPS_DEV}
+            echo "success"
+       else
+           # User needs to symlink ${GPS_DEV} to the right thing
+           echo "No ${GPS_DEV} GPS device, aborting gpsd startup. Check /etc/default/$prog"
+       fi
+       RETVAL=$?
+       echo
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gpsd
+       return $RETVAL
+}
+
+stop() {
+       # Stop daemons.
+       echo -n "Shutting down $prog: "
+
+       gllin_PIDs="`ps ax | grep "/home/root/gllin" | grep -v grep | awk '{print $1}'`"        
+       test -n "$gllin_PIDs" && kill $gllin_PIDs
+
+        killall gpsd
+        killproc gpsd
+       RETVAL=$?
+       echo
+       if [ $RETVAL -eq 0 ]
+       then
+           rm -f /var/lock/subsys/gpsd;
+       fi
+       return $RETVAL
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart|reload)
+       stop
+       start
+       RETVAL=$?
+       ;;
+  condrestart)
+       if [ -f /var/lock/subsys/gpsd ]; then
+           stop
+           start
+           RETVAL=$?
+       fi
+       ;;
+  status)
+#      status gpsd
+#      RETVAL=$?
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|condrestart|status}"
+       exit 1
+esac
+
+exit $RETVAL
============================================================
--- packages/gpsd/files/fic-gta01/gpsd-default  c45e36caad5bdf37b7d5defe8f18d431e25f9bd4
+++ packages/gpsd/files/fic-gta01/gpsd-default  c45e36caad5bdf37b7d5defe8f18d431e25f9bd4
@@ -0,0 +1,3 @@
+# If you must specify a non-NMEA driver, uncomment and modify the next line
+#GPSD_OPTS=
+GPS_DEV="/tmp/nmeaNP"
============================================================
--- packages/gpsd/gpsd_2.34.bb  4ea8e37b9fbdf1a614c46bcd12247dffa2d96067
+++ packages/gpsd/gpsd_2.34.bb  8e241bbd828101019cda7b30a6725fd6759f50f4
@@ -1,4 +1,4 @@ require gpsd.inc
 require gpsd.inc

-PR = "r5"
+PR = "r6"

_______________________________________________
Openembedded-commits mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-commits

===8<===========End of original message text===========

Signature · 2 lines
Best regards,
 Paul                            mailto:[email protected]
#2 lore raw

Hey there.

Am Dienstag, den 01.01.2008, 19:03 +0200 schrieb Paul Sokolovsky:

Quoted 6 lines

Hello,

      Working default configuration should go to ${PN}-conf or

something, like most of OE does, and few remaining uncomplying packages are being converted. This helps with build, QA, and release management. Thanks.

could you please point me to a sample package with acceptable integration of -conf? I'd rather _not_ do this a third time.

Signature · 7 lines
Matthias 'CoreDump' Hentges 
Cologne / Germany

Webmaster of Hentges.net & Embedded Linux Developer
GPG ->  gpg --keyserver gpg-keyserver.de --recv-keys 0xAF3030D9

My OS: Debian SID: Geek by Nature, Linux by Choice
#3 lore raw

Hello Matthias,

Quoted 5 lines · you

Hey there.

Am Dienstag, den 01.01.2008, 19:03 +0200 schrieb Paul Sokolovsky:

Quoted 2 lines

Hello,

Quoted 7 lines
Quoted 4 lines
      Working default configuration should go to ${PN}-conf or

something, like most of OE does, and few remaining uncomplying packages are being converted. This helps with build, QA, and release management. Thanks.

could you please point me to a sample package with acceptable integration of -conf? I'd rather _not_ do this a third time.

mplayer & mplayer-common by you are good examples. mplayer-common so
far is not machine-specific, but if we'll *really* find it beneficial to make it so, we're all set for that. keylaunch & keylaunch-conf are another recent refactor, by me, with keylaunch-conf being actually per-machine.

I see where current problem lies with the code you committed - in
snippet like this:

+# gpsd This shell script starts and stops gpsd.
[]
+ if test -e /home/root/gllin/gllin
+ then
+ /home/root/gllin/gllin >/var/log/gllin.log 2>&1 &
+ else

+               echo -e "\n\ngllin GPS driver for Neo1973 not found,"
+               echo "please install the gllin package from"
+               echo "http://3rdparty.downloads.openmoko.org/gllin/"
+               echo ""
+               exit 1

+ fi

So, one thing is device-specific conf, another way is generic gpsd's
device-specific service init. But that's why it would be nice if we adopted soft vs soft-conf split as consistent best practice - then snippets like above would seem to us as anomaly right away, and we'd think how to solve it.

The issue here that /etc/init.d/gpsd tries to init both gpsd and
gps hardware. Why not separate them. Say, have /etc/init.d/gllin with that snippet. But wait, there're different GPS hardware exists, why don't we make it polymorphic? So, we'd have /etc/init.d/gps-hardware, and that's for should would be device-specific. Then, /etc/init.d/gpsd could do sth like:

[ -x /etc/init.d/gps-hardware ] && /etc/init.d/gps-hardware start

to make sure that it ups entire GPS system.

How does that sound?

Signature · 2 lines
Best regards,
 Paul                            mailto:[email protected]
#4 lore raw

Am Dienstag, den 01.01.2008, 21:42 +0200 schrieb Paul Sokolovsky:

Quoted 45 lines

Hello Matthias,

Quoted 5 lines · you

Hey there.

Am Dienstag, den 01.01.2008, 19:03 +0200 schrieb Paul Sokolovsky:

Quoted 2 lines

Hello,

Quoted 7 lines
Quoted 4 lines
      Working default configuration should go to ${PN}-conf or

something, like most of OE does, and few remaining uncomplying packages are being converted. This helps with build, QA, and release management. Thanks.

could you please point me to a sample package with acceptable integration of -conf? I'd rather _not_ do this a third time.

mplayer & mplayer-common by you are good examples. mplayer-common so
far is not machine-specific, but if we'll *really* find it beneficial to make it so, we're all set for that. keylaunch & keylaunch-conf are another recent refactor, by me, with keylaunch-conf being actually per-machine.

I see where current problem lies with the code you committed - in
snippet like this:

+# gpsd This shell script starts and stops gpsd.
[]

(quoted diff) +10 -0
+       if test -e /home/root/gllin/gllin
+       then
+               /home/root/gllin/gllin >/var/log/gllin.log 2>&1 &
+       else
+               echo -e "\n\ngllin GPS driver for Neo1973 not found,"
+               echo "please install the gllin package from"
+               echo "http://3rdparty.downloads.openmoko.org/gllin/"
+               echo ""
+               exit 1
+       fi
 
  So, one thing is device-specific conf, another way is generic gpsd's

device-specific service init. But that's why it would be nice if we adopted soft vs soft-conf split as consistent best practice - then snippets like above would seem to us as anomaly right away, and we'd think how to solve it.

Quoted 3 lines

The issue here that /etc/init.d/gpsd tries to init both gpsd and
gps hardware. Why not separate them. Say, have /etc/init.d/gllin with that snippet.

Difficult. /e/i/gllin should, if at all, be provided by the gllin package. It is a hand-crafted ipkg containing a binary-only driver. It will be an interesting task to find someone at OM willing to change it. Maybe if I annoy mickey enough... ;)

Quoted 10 lines

But wait, there're different GPS hardware exists, why
don't we make it polymorphic? So, we'd have /etc/init.d/gps-hardware, and that's for should would be device-specific. Then, /etc/init.d/gpsd could do sth like:

[ -x /etc/init.d/gps-hardware ] && /etc/init.d/gps-hardware start

to make sure that it ups entire GPS system.

How does that sound?

That sounds like a very good idea, I like the generic approach better than a hard-coded init-script. I will try to get the gllin ipk changed, but that may take a few days.

What do you think about installing /etc/default/gpsd via update-alternatives so a driver could install proper defaults w/o resorting to a -conf at all?

Not that many drivers are going to do this. Neo1973 is probably a very special case in this regard.

Signature · 7 lines
Matthias 'CoreDump' Hentges 
Cologne / Germany

Webmaster of Hentges.net & Embedded Linux Developer
GPG ->  gpg --keyserver gpg-keyserver.de --recv-keys 0xAF3030D9

My OS: Debian SID: Geek by Nature, Linux by Choice
#5 lore raw

Hello Matthias,

Tuesday, January 1, 2008, 10:09:25 PM, you wrote:

[]

Quoted 8 lines
Quoted 3 lines

The issue here that /etc/init.d/gpsd tries to init both gpsd and
gps hardware. Why not separate them. Say, have /etc/init.d/gllin with that snippet.

Difficult. /e/i/gllin should, if at all, be provided by the gllin package. It is a hand-crafted ipkg containing a binary-only driver. It will be an interesting task to find someone at OM willing to change it. Maybe if I annoy mickey enough... ;)

Well, I don't call to create a real package for gllin, it would
still contain just that notice - "go url, clickthru, download". Well, that clickthru license and download could be moved into such package, but that still rather be done by core OM people, keeping a connection with FIC's legal dept ;-).

Quoted 7 lines
Quoted 7 lines

But wait, there're different GPS hardware exists, why
don't we make it polymorphic? So, we'd have /etc/init.d/gps-hardware, and that's for should would be device-specific. Then, /etc/init.d/gpsd could do sth like:

[ -x /etc/init.d/gps-hardware ] && /etc/init.d/gps-hardware start

Quoted 7 lines
Quoted 3 lines

to make sure that it ups entire GPS system.

How does that sound?

That sounds like a very good idea, I like the generic approach better than a hard-coded init-script. I will try to get the gllin ipk changed, but that may take a few days.

Great! I think, we should do similar for BT. Note that there's
currently no flexible way to deal with BT *hardware* in OE. blue-probe just records static external properties of BT hardware. But how that HW is inited? The current way us to have BT drivers kernel-builtin, or auto-loaded per machine config. That has its issues - memory is taken regardless if BT is actually used, plus for some devices that may course BT HW to be always active, draining power.

Quoted 6 lines

What do you think about installing /etc/default/gpsd via update-alternatives so a driver could install proper defaults w/o resorting to a -conf at all?

Not that many drivers are going to do this. Neo1973 is probably a very special case in this regard.

Well, there're other devices with GPS builtin (few HTC phones),
that's why I raised the question. Plus, we could have gpsd-conf-usb and gpsd-conf-bt. Taking the above, update-alternatives management would be quite helpful. But how they are structured package wise is up to different alternatives, e.g.:

1. One big package with few conf's inside, managed by update-alt.
2. pkg and pkf-conf, with the latter containing confs, managed by update-alt.
3. Bunch of conf packages, managed by update-alt.

I'd err on fine-grained packaging, but I understand that it makes
no sense to put every 20-byte file into own package. I'd still prefer 2, as with it, updating configs does *not* require: 1) devels to rebuild whole source; 2) release managers to upload more bytes to feeds; 3) users download those bytes, times many.

Anyway, I don't have strong opinion here. All 3 choices are valid, as
called by specific case. As long as we agree on the general plan to deal with this, it can be changed to another method if practical need arises.

Signature · 2 lines
Best regards,
 Paul                            mailto:[email protected]
#6 lore raw
In reply to a message not in the archive

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

coredump2 commit schreef:

Quoted 1 line

gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

the (recently renamed) machine_id function exists for a reason. gta0* is runtime detectable, so no reason to hardcode it at buildtime. And if people insist on buildtime hardcodes, but the stuff in ${PN}-conf or something.

- --
[email protected] will go go away in december 2007, please use [email protected] instead.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFHenRpMkyGM64RGpERAjztAJ4nPr9CmM7O3lBj8C/UOmrBDEdv3wCgsx6C ViBarcTWDPu136ztHVCr178=
=m7d8
-----END PGP SIGNATURE-----

#7 lore raw

Am Dienstag, den 01.01.2008, 18:12 +0100 schrieb Koen Kooi:

Quoted 8 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

coredump2 commit schreef:

Quoted 1 line

gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

the (recently renamed) machine_id function exists for a reason. gta0* is runtime detectable, so no reason to hardcode it at buildtime.

Are you seriously suggesting hacking gpsd to runtime-detect the device it's running on and auto-configure itself _just_ so you can point to machine_id and make life for everyone a bit more difficult?

You can't expect people to hack apps just so the apps fit your holy image of a "good" build environment, it is the other way around my friend.

Quoted 3 lines

And if
people insist on buildtime hardcodes, but the stuff in ${PN}-conf or something.

Please stop your trolling. Paul took the two minutes to think up some understandable reasons for the change-request. Your mail, OTOH didn't add any value at all to this thread, and is just wasted bandwidth, like usual.

If I see any more of this trolling nonsense thrown my way, I will add you to my killfile. I don't care what you think, what you say, or what you write.
Very few people these days do take you seriously, that is something to think about.

Signature · 7 lines
Matthias 'CoreDump' Hentges 
Cologne / Germany

Webmaster of Hentges.net & Embedded Linux Developer
GPG ->  gpg --keyserver gpg-keyserver.de --recv-keys 0xAF3030D9

My OS: Debian SID: Geek by Nature, Linux by Choice
#8 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthias Hentges schreef:

Quoted 4 lines

Am Dienstag, den 01.01.2008, 18:12 +0100 schrieb Koen Kooi:

Quoted 3 lines

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines
Quoted 4 lines

coredump2 commit schreef:

Quoted 1 line

gpsd: Provide working default configuration and init-script for fic-gta01. This makes gpsd device-specific for gta01, please check the feeds.

the (recently renamed) machine_id function exists for a reason. gta0* is runtime detectable, so no reason to hardcode it at buildtime.

Are you seriously suggesting hacking gpsd to runtime-detect the device it's running on and auto-configure itself _just_ so you can point to machine_id and make life for everyone a bit more difficult?

machine_id is sourced in the initscripts, if you would have bothered to look.

- --
[email protected] will go go away in december 2007, please use [email protected] instead.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFHeqEkMkyGM64RGpERAix4AKCDMsHZ9h7V6y6W9ym/Sy641sjrXgCgqhFn fXhuoUAxzI8PcN4kOslXoCc=
=L1IP
-----END PGP SIGNATURE-----