Skip to contentSkip to conversation

gsmd machine dependent configuration and PACKAGE_ARCH

PATCH pHilipp Zabel 2 participants 2 messages Aug 22, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I don't like how currently all (lib)gsmd(-plugin-...) packages are PACKAGE_ARCH="${MACHINE_ARCH}" just because of the small /etc/default/gsmd configuration file. Are there any objections to the patch below? It uses a single configuration file for all currently supported machines, parsing /proc/cpuinfo similarly to how Xserver configuration is done in xserver-kdrive-common.

regards
Philipp

#

# old_revision [386ea80af330bd25812f5cdff58b9291ad20ed55]
#
# delete "packages/gsm/files/fic-gta01"
#
# delete "packages/gsm/files/fic-gta01/default"
#
# delete "packages/gsm/files/htcuniversal"
#
# delete "packages/gsm/files/htcuniversal/default"
#
# delete "packages/gsm/files/magician"
#
# delete "packages/gsm/files/magician/default"
#
# patch "packages/gsm/files/default"
#  from [7ce0e5ef1d869657220f2726615b4248e22cf672]
#    to [ec341c8038634b15744e9c6b74f64b81cee153b3]
#
# patch "packages/gsm/libgsmd_svn.bb"
#  from [5bfef07ab90056b98c4bcf253d3d8773ff46f2e9]
#    to [d593ae51c7fbbde0555e0fead8b05db83e9016a5]
#
============================================================
--- packages/gsm/files/default	7ce0e5ef1d869657220f2726615b4248e22cf672
+++ packages/gsm/files/default	ec341c8038634b15744e9c6b74f64b81cee153b3
@@ -1,9 +1,34 @@
 # gsmd	This shell script configures for the gsmd init script.

-# If you must specify special options, uncomment and modify the next line -#GSMD_OPTS="-s 115200 -F"
+board_id() {
+ awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}

-# If your GSM device needs to be powered up, uncomment and modify the next line -#GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on"
+case board_id in
+ "GTA01")
+ GSMD_OPTS="-s 115200 -F"
+ GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on"
+ GSM_DEV="/dev/ttySAC0"
+ ;;
+ "HTC Magician")
+ GSMD_OPTS="-s 115200 -F"
+ GSM_DEV="/dev/ttyS1"
+ ;;
+ "HTC Universal")
+ GSMD_OPTS="-s 115200 -F -w 1"
+ GSM_DEV="/dev/ttyS0"
+ ;;
+ *)
+ # Unknown board

+ # If you must specify special options, uncomment and modify the next line
+ #GSMD_OPTS="-s 115200 -F"
+
+ # If your GSM device needs to be powered up, uncomment and modify
the next line
+ #GSM_POW="/sys/bus/platform/devices/gta01-pm-gsm.0/power_on"
+
+ # This should be in a common /etc/default/serial, together with
+ # BT_DEV and IR_DEV for devices that have those on a serial port
+ #GSM_DEV="/dev/ttyS1"
+ ;;
+esac
-#GSM_DEV="/dev/ttyS1"
============================================================

gsm/libgsmd_svn.bb +1 -3
@@ -1,13 +1,11 @@ PROVIDES += "gsmd"
 DESCRIPTION = "GSM libraries and daemons implementing the 07.10 specification"
 HOMEPAGE = "http://www.openmoko.org"
 LICENSE = "GPL LGPL"
 SECTION = "libs/gsm"
 PROVIDES += "gsmd"
 PV = "0.1+svn${SRCDATE}"
-PR = "r19"
+PR = "r20"
 
-SRC_URI_OVERRIDES_PACKAGE_ARCH = "1"
-
 SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \
            file://fix-mlbuf.patch;patch=1 \
            file://gsmd \
#1 lore raw

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

pHilipp Zabel schreef:

Quoted 8 lines

Hi,

I don't like how currently all (lib)gsmd(-plugin-...) packages are PACKAGE_ARCH="${MACHINE_ARCH}" just because of the small /etc/default/gsmd configuration file. Are there any objections to the patch below? It uses a single configuration file for all currently supported machines, parsing /proc/cpuinfo similarly to how Xserver configuration is done in xserver-kdrive-common.

One small suggestion:

Author: [email protected]
Revision: a11f318a90beef34d84711b348b891eddfabc2bf packages/initscripts/initscripts-1.0/functions

initscripts: add a functions script that is supposed to be sourced from individual init scripts providing some useful functions.
added cpuinfo_id() and killproc() for a start

============================================================
- --- packages/initscripts/initscripts-1.0/functions cdb873e9c652d090c2e40fa96d5fd2db86db5413
+++ packages/initscripts/initscripts-1.0/functions cdb873e9c652d090c2e40fa96d5fd2db86db5413
@@ -0,0 +1,17 @@
+# -*-Shell-script-*-
+#
+# functions This file contains functions to be used by most or all
+# shell scripts in the /etc/init.d directory.
+#
+
+cpuinfo_id() { # return the Hardware module ID
+ awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}
+
+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" != "" ] && kill $pid
+}

regards,

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

iD8DBQFGy/R9MkyGM64RGpERAlJ1AJ0YIedmbKy5wQ+ERcw5bFcBJOeifgCcDTBc 7WwtqT6BHh/lwnT6kiDzgBQ=
=HRWu
-----END PGP SIGNATURE-----