16
Security and Networking / Bluez Works, But Has Some Quirks
« on: May 22, 2005, 05:24:59 pm »
With regards to building BlueZ for a 2.4.20 kernel based zaurus here are some simple instructions, going off memory. (I really need to write a full howto if only for myself):
Download the following:
http://developer.ezaurus.com/sl_j/source/c...rom1_01.tar.bz2
http://www.bluez.org/redirect.php?url=http...ibs-2.17.tar.gz
http://www.bluez.org/redirect.php?url=http...ils-2.17.tar.gz
http://www.bluez.org/redirect.php?url=http...-2.4.20-mh18.gz
Then do the following in a directory of your choice:
tar jxvf linux-c3000-20041116-rom1_01.tar.bz2
ln -s linux linux-2.4.20
zcat patch-2.4.20-mh18.gz | patch -p0 (that's a zero)
cd linux
make menuconfig
Load alternate configuration file and enter 'arch/arm/def-configs/spitz-j'
Then go into Bluetooth Support and set everything as modules and select every option.
Save and exit the kernel configuration.
Edit Makefile and delete the mh18 after the 'EXTRAVERSION ='
Some code needs to be added to the bluez patch and the Sharp kernel sources are missing bits. After the includes at the top of net/bluetooth/bnep/sock.c and net/bluetooth/cmtp/sock.c you need to insert the following:
Make sure you have your cross-compile environment setup before doing any compiling.
Then as usual run:
make dep
make modules
You should find the core BlueZ modules under net/bluetooth, which are:
bluez.o
bnep/bnep.o
l2cap.o
rfcomm/rfcomm.0
sco.o
The BlueZ driver modules are under drivers/bluetooth, which are:
bfusb.o
bluecard_cs.o
bt3c_cs.o
btuart_cs.o
dtl1_cs.o
hci_uart.o
hci_usb.o
hci_vhci.o
The bluez-libs and bluez-utils packages are setup using the configure script. For bluez-libs this is simply:
The resultant library is bluez-libs/src/.libs/libbluetooth.so
bluez-utils needs to be pointed to the include and libs just compiled in bluez-libs. I think it goes something like:
The binaries creates are:
bluez-libs/dund/dund
bluez-libs/pand/pand
bluez-libs/hcid/hcid
bluez-libs/rfcomm/rfcomm
bluez-libs/tools/hciattach
bluez-libs/tools/hciconfig
bluez-libs/tools/l2ping
bluez-libs/tools/sdptool
Hope I got that right.
Download the following:
http://developer.ezaurus.com/sl_j/source/c...rom1_01.tar.bz2
http://www.bluez.org/redirect.php?url=http...ibs-2.17.tar.gz
http://www.bluez.org/redirect.php?url=http...ils-2.17.tar.gz
http://www.bluez.org/redirect.php?url=http...-2.4.20-mh18.gz
Then do the following in a directory of your choice:
tar jxvf linux-c3000-20041116-rom1_01.tar.bz2
ln -s linux linux-2.4.20
zcat patch-2.4.20-mh18.gz | patch -p0 (that's a zero)
cd linux
make menuconfig
Load alternate configuration file and enter 'arch/arm/def-configs/spitz-j'
Then go into Bluetooth Support and set everything as modules and select every option.
Save and exit the kernel configuration.
Edit Makefile and delete the mh18 after the 'EXTRAVERSION ='
Some code needs to be added to the bluez patch and the Sharp kernel sources are missing bits. After the includes at the top of net/bluetooth/bnep/sock.c and net/bluetooth/cmtp/sock.c you need to insert the following:
Code: [Select]
static inline struct socket *socki_lookup(struct inode *inode)
{
   return &inode->u.socket_i;
}
static struct socket *sockfd_lookup(int fd, int *err)
{
   struct file *file;
   struct inode *inode;
   struct socket *sock;
   if (!(file = fget(fd))) {
       *err = -EBADF;
       return NULL;
   }
   inode = file->f_dentry->d_inode;
   if (!inode->i_sock || !(sock = socki_lookup(inode))) {
       *err = -ENOTSOCK;
       fput(file);        return NULL;
   }
   if (sock->file != file) {
       printk(KERN_ERR "socki_lookup: socket file changed!\n");
       sock->file = file;
   }
   return sock;
}
Make sure you have your cross-compile environment setup before doing any compiling.
Then as usual run:
make dep
make modules
You should find the core BlueZ modules under net/bluetooth, which are:
bluez.o
bnep/bnep.o
l2cap.o
rfcomm/rfcomm.0
sco.o
The BlueZ driver modules are under drivers/bluetooth, which are:
bfusb.o
bluecard_cs.o
bt3c_cs.o
btuart_cs.o
dtl1_cs.o
hci_uart.o
hci_usb.o
hci_vhci.o
The bluez-libs and bluez-utils packages are setup using the configure script. For bluez-libs this is simply:
Code: [Select]
CC=arm-linux-gcc ./configure --host=arm-linux
Then run 'make'The resultant library is bluez-libs/src/.libs/libbluetooth.so
bluez-utils needs to be pointed to the include and libs just compiled in bluez-libs. I think it goes something like:
Code: [Select]
CPPFLAGS="-Iyour/path/bluez-libs/include -Lyour/path/bluez-libs/src/.libs" CC=arm-linux-gcc ./configure --host=arm-linux
Then run 'make' again.The binaries creates are:
bluez-libs/dund/dund
bluez-libs/pand/pand
bluez-libs/hcid/hcid
bluez-libs/rfcomm/rfcomm
bluez-libs/tools/hciattach
bluez-libs/tools/hciconfig
bluez-libs/tools/l2ping
bluez-libs/tools/sdptool
Hope I got that right.