Hi Michael,

I did some work on that package too, attached. It compiles and installs, but does not work 100% yet. I found it rather difficult to see what is going wrong, 4.99 seems very different from 3.x. It may be old, but it works...

Regards,
Jeroen

On 05/26/12 16:01, Michael Markstaller wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
just started to play with bluez a little on OpenWRT and noted it's
pretty old. I'm after the brand new Proximity Reporter API..

Well, so I started some packaging-work for current 4.99 (which looks
like a bunch of work..)

Some questions in advance:
a) Are there some special reasons for using 3.x that I missed?
b) what are typical usage-cases for bluez on OpenWRT that should get
tested/considered when packaging bluez 4.x?
c) Any ongoing work on this?
d) there are (3.x) two packages (bluez-libs and bluez-utils), I'd join
them together; would mainly look at what the debian-packaging does for 4.x
e) would it be better to create bluez4-*-packages?

Any thoughts welcome ;) With many quirks, it compiles already..

Michael
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/BUsYACgkQaWRHV2kMuAJV1gCeNnX6K120rMzbBJrm+VimVcSX
krEAoNapLlEqKgdNEptzFZiP1NUR67/X
=WEMe
-----END PGP SIGNATURE-----
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=bluez
PKG_VERSION:=4.99
PKG_RELEASE:=10

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/
# PKG_MD5SUM:=4fc292b635ba7b442c7aaf5680199012

PKG_FIXUP:=libtool

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk

# +gst-plugins-base for gstreamer

define Package/bluez
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libpthread +dbus +glib2 $(INTL_DEPENDS) $(ICONV_DEPENDS)
  TITLE:=Bluetooth utilities
  URL:=http://www.bluez.org/
endef

define Package/bluez/conffiles
/etc/bluetooth/main.conf
/etc/bluetooth/rfcomm.conf
/etc/config/bluetooth
endef

CONFIGURE_ARGS += \
        --enable-pand \
        --enable-dund \
        --enable-serial \
        --enable-network \
        --enable-usb \
        --enable-input \
        --enable-audio \
        --disable-gstreamer \
        --enable-alsa \
        --enable-tools \
        --enable-datafiles

define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                LDFLAGS="$(TARGET_LDFLAGS) \
                        -L$(ICONV_PREFIX)/lib \
                        -L$(INTL_PREFIX)/lib -lm" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all install
endef

define Package/bluez/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/usr/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/bluetooth
        $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/main.conf $(1)/etc/bluetooth/
        $(CP) $(PKG_INSTALL_DIR)/etc/bluetooth/rfcomm.conf $(1)/etc/bluetooth/
        $(CP) $(PKG_BUILD_DIR)/serial/serial.conf $(1)/etc/bluetooth/
        $(CP) $(PKG_BUILD_DIR)/audio/audio.conf $(1)/etc/bluetooth/
        $(CP) $(PKG_BUILD_DIR)/input/input.conf $(1)/etc/bluetooth/
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
        $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
        $(INSTALL_DATA) ./files/bluetooth.dbus 
$(1)/etc/dbus-1/system.d/bluetooth.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/bluez.init $(1)/etc/init.d/bluez
endef

$(eval $(call BuildPackage,bluez))
--- a/plugins/formfactor.c
+++ b/plugins/formfactor.c
@@ -34,87 +34,10 @@
 #include "adapter.h"
 #include "log.h"
 
-#define DMI_CHASSIS_FILE "/sys/class/dmi/id/chassis_type"
-#define DMI_CHASSIS_FILE_FALLBACK "/sys/devices/virtual/dmi/id/chassis_type"
-
-/* Map the chassis type from chassis_type to a sensible type used in hal
- *
- * See also 3.3.4.1 of the "System Management BIOS Reference Specification,
- * Version 2.6.1" (Preliminary Standard) document, available from
- * http://www.dmtf.org/standards/smbios.
- *
- * TODO: figure out WTF the mapping should be; "Lunch Box"? Give me a break :-)
- *
- * Copied from hal/hald/linux/osspec.c
- */
-static const char *chassis_map[] = {
-	"Other",                 "unknown", /* 0x01 */
-	"Unknown",               "unknown",
-	"Desktop",               "desktop",
-	"Low Profile Desktop",   "desktop",
-	"Pizza Box",             "server",
-	"Mini Tower",            "desktop",
-	"Tower",                 "desktop",
-	"Portable",              "laptop",
-	"Laptop",                "laptop",
-	"Notebook",              "laptop",
-	"Hand Held",             "handheld",
-	"Docking Station",       "laptop",
-	"All In One",            "unknown",
-	"Sub Notebook",          "laptop",
-	"Space-saving",          "desktop",
-	"Lunch Box",             "unknown",
-	"Main Server Chassis",   "server",
-	"Expansion Chassis",     "unknown",
-	"Sub Chassis",           "unknown",
-	"Bus Expansion Chassis", "unknown",
-	"Peripheral Chassis",    "unknown",
-	"RAID Chassis",          "unknown",
-	"Rack Mount Chassis",    "unknown",
-	"Sealed-case PC",        "unknown",
-	"Multi-system",          "unknown",
-	"CompactPCI",            "unknown",
-	"AdvancedTCA",           "unknown",
-	"Blade",                 "server",
-	"Blade Enclosure",       "unknown", /* 0x1D */
-	NULL
-};
-
 static int formfactor_probe(struct btd_adapter *adapter)
 {
-	int chassis_type;
-	uint8_t minor = 0;
-	const char *formfactor;
-	char *contents;
-
-	if (g_file_get_contents(DMI_CHASSIS_FILE,
-				&contents, NULL, NULL) == FALSE) {
-		if (g_file_get_contents(DMI_CHASSIS_FILE_FALLBACK,
-					&contents, NULL, NULL) == FALSE) {
-			error("Could not get the contents of DMI chassis type");
-			return 0;
-		}
-	}
-
-	chassis_type = atoi(contents);
-	g_free (contents);
-
-	if (chassis_type > 0x1D || chassis_type <= 0) {
-		error ("Chassis type is not a known chassis type");
-		return 0;
-	}
-
-	formfactor = chassis_map[chassis_type * 2 - 1];
-	if (formfactor != NULL) {
-		if (g_str_equal(formfactor, "laptop") == TRUE)
-			minor |= (1 << 2) | (1 << 3);
-		else if (g_str_equal(formfactor, "desktop") == TRUE)
-			minor |= 1 << 2;
-		else if (g_str_equal(formfactor, "server") == TRUE)
-			minor |= 1 << 3;
-		else if (g_str_equal(formfactor, "handheld") == TRUE)
-			minor += 1 << 4;
-	}
+	uint8_t minor = 1 << 3;
+	// const char *formfactor = "server";
 
 	/* Computer major class */
 	DBG("Setting 0x%06x for major/minor device class", (1 << 8) | minor);
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to