=== modified file 'debian/control' --- debian/control 2010-08-04 17:59:41 +0000 +++ debian/control 2010-08-12 10:16:30 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Andres Salomon -Build-Depends: debhelper (>= 7.0.50~), libglib2.0-dev (>= 2.16), libdbus-glib-1-dev, libudev-dev, udev, libcap-ng-dev +Build-Depends: debhelper (>= 7.0.50~), libglib2.0-dev (>= 2.16), libdbus-glib-1-dev, libudev-dev, udev, libcap-ng-dev, cdbs, quilt Standards-Version: 3.9.1 Homepage: http://www.ofono.org/ === added directory 'debian/patches' === added file 'debian/patches/01-check-that-modem-name-is-valid.patch' --- debian/patches/01-check-that-modem-name-is-valid.patch 1970-01-01 00:00:00 +0000 +++ debian/patches/01-check-that-modem-name-is-valid.patch 2010-08-06 11:44:57 +0000 @@ -0,0 +1,53 @@ +Check that modem name is valid otherwise fallback to using type + +From: Kalle Valo + +Some Huawei modems (this one is from Huawei E620) have garbage as serial data: + +E: ID_SERIAL=ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ_HUAWEI_Mobile_ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ +E: ID_SERIAL_SHORT=ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ +E: ID_BUS=usb +E: ID_USB_INTERFACES=:ffffff:080650: +E: ID_VENDOR_FROM_DATABASE=Huawei Technologies Co., Ltd. +E: ID_MODEL_FROM_DATABASE=E620 USB Modem + +Huawei plugin uses serial as the name for the modem. But because the +garbage is not a valid path name, modem creation fails. + +Fix it by falling back to using type if the check for name fails. +--- + src/modem.c | 13 ++++++++++--- + 1 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/modem.c b/src/modem.c +index f89d609..70df159 100644 +--- a/src/modem.c ++++ b/src/modem.c +@@ -1267,6 +1267,7 @@ void ofono_modem_set_name(struct ofono_modem *modem, const char *name) + struct ofono_modem *ofono_modem_create(const char *name, const char *type) + { + struct ofono_modem *modem; ++ gboolean use_name; + char path[128]; + + DBG("name: %s, type: %s", name, type); +@@ -1277,10 +1278,16 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type) + if (name && strlen(name) > 64) + return NULL; + +- if (name == NULL) +- snprintf(path, sizeof(path), "/%s%d", type, next_modem_id); +- else ++ if (name != NULL) { + snprintf(path, sizeof(path), "/%s", name); ++ use_name = __ofono_dbus_valid_object_path(path); ++ } else ++ use_name = FALSE; ++ ++ if (use_name) ++ snprintf(path, sizeof(path), "/%s", name); ++ else ++ snprintf(path, sizeof(path), "/%s%d", type, next_modem_id); + + if (__ofono_dbus_valid_object_path(path) == FALSE) + return NULL; === added file 'debian/patches/series' --- debian/patches/series 1970-01-01 00:00:00 +0000 +++ debian/patches/series 2010-08-06 11:44:57 +0000 @@ -0,0 +1,1 @@ +01-check-that-modem-name-is-valid.patch === modified file 'debian/rules' --- debian/rules 2009-10-18 23:54:52 +0000 +++ debian/rules 2010-08-06 11:29:18 +0000 @@ -1,7 +1,5 @@ #!/usr/bin/make -f -%: - dh $@ - -override_dh_strip: - dh_strip --dbg-package=ofono-dbg +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk