Archive for June, 2008

Sabayon: Installing synce-svn

June 29th, 2008 by tripledes

Sabayon LinuxAs owner of three Windows Mobile devices (HTC Universal, Hermes and Kaiser) I needed a way to work with them under Linux so I decided to install SynCE following this wiki entry.

It was pretty straight ahead compilation, just encountered some minor problems which I could fix really easily. First we need to install subversion and gnet:

$ sudo equo install subversion gnet

Then create a build folder which will hold the sources of everything we need:

$ mkdir builds
$ cd builds
$ svn checkout http://synce.svn.sourceforge.net/svnroot/synce/trunk/libsynce
$ svn checkout http://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2
$ svn checkout http://synce.svn.sourceforge.net/svnroot/synce/trunk/odccm
$ svn checkout http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite

Now the compilation begins!

$ cd libsynce
$ ./autogen.sh
$ make && sudo make install

Now we’d have libsynce installed under /usr/local so let’s start with librapi2.

$ cd ../librapi2
$ ./autogen.sh

And the first problem shows up:

checking for LIBSYNCE... configure: error: Package requirements (libsynce >= 0.11.1) were not met:

No package 'libsynce' found

Fix:

$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
$ ./autogen.sh
$ make

And the second problem comes to scene:

/bin/sh ../libtool --tag=CC --mode=link gcc -I/usr/local/include -pthread -Wsign-compare -Wno-long-long -o pcp pcommon.o pcp.o ../src/librapi.la
gcc -I/usr/local/include -pthread -Wsign-compare -Wno-long-long -o .libs/pcp pcommon.o pcp.o ../src/.libs/librapi.so
pcommon.o: In function `adjust_remote_path':
pcommon.c:(.text+0xe0): undefined reference to `wstr_append'
pcommon.c:(.text+0xfa): undefined reference to `wstr_append'
pcommon.c:(.text+0x111): undefined reference to `wstr_free_string'
pcommon.c:(.text+0x131): undefined reference to `_synce_log_wstr'
pcommon.c:(.text+0x143): undefined reference to `wstrdup'
pcommon.o: In function `anyfile_remote_close':
....

Fix:

$ make LIBS=/usr/local/lib/libsynce.so

And here it comes again:

g++ -I/usr/local/include -Wall -pthread -g -O2 /usr/local/lib -o .libs/CeCreateDatabase CeCreateDatabase.o /usr/local/lib/libsynce.so ../../src/.libs/librapi.so
/usr/local/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status

Fix:

$ cd tests/rapi

Edit the Makefile and look for a line like:

AM_LDFLAGS = /usr/local/lib

and comment it. I’m sure there’s a proper fix for this but it worked for me, so let’s try to build librapi2 again:

$ cd ../../
$ make LIBS=/usr/local/lib/libsynce.so && sudo make install

Now it should compile without a problem and install everything again under /usr/local. Let’s start with odccm:

$ cd ../odccm
$ make LIBS=/usr/local/lib/libsynce.so

And the same last problem shows up again:

gcc -Wall -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/gnet-2.0 -I/usr/lib/gnet-2.0/include/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -g -O2 -o odccm odccm-device-signals-marshal.o odccm-device-manager-signals-marshal.o util.o odccm-errors.o odccm-connection-broker.o odccm-device.o odccm-device-manager.o odccm.o odccm-device-legacy.o /usr/local/lib -lgobject-2.0 -lglib-2.0 -pthread -lgnet-2.0 -lgthread-2.0 -lrt -lglib-2.0 -ldbus-glib-1 -ldbus-1 -lgobject-2.0 -lglib-2.0 -lhal -ldbus-1
/usr/local/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status

Fix:

$ cd src

Edit the Makefile and look for the line odccm_LDADD = /usr/local/lib … and add -L after the equal.

odccm_LDADD = -L /usr/local/lib ...

So let’s compile:

$ make LIBS=/usr/local/lib/libsynce.so && sudo make install

So all userland is installed, let’s compile the kernel modules:

$ cd ../usb-rndis-lite
$ make && sudo make install

Keep in mind the kernel modules will have to be built every time the kernel is updated. So…let’s test! Plug your device in:

$ sudo /usr/local/sbin/odccm
$ dmesg | grep rndis
...
[86530.903513] rndis0: register 'rndis_host' at usb-0000:00:1d.1-1, RNDIS device (SynCE patched), 80:00:60:0f:e8:00
[86541.176471] rndis0: no IPv6 routers present
...
$ /usr/local/bin/pls
Directory 2008-05-04 22:00:24 My Pictures/
Directory 2008-05-04 22:00:24 Templates/
Directory 2008-05-04 22:00:26 Personal/
Directory 2008-05-04 22:00:26 Business/
Directory 2008-05-04 22:00:26 My Music/
Directory 2008-05-04 22:00:26 My Ringtones/
Directory 2008-05-04 22:00:26 UAContents/
$

The device is detected and we can start working with it :)

Tags: , , ,

From Cisco VPN Client to vpnc

June 28th, 2008 by tripledes

I was looking for an easy way to take away the Cisco VPN client for an open source solution, vpnc. It’s a quite simple solution, which allows to convert Cisco profile files to its own configuration format and just works.

First take you .pcf file and convert it:

pcf2vpnc /path/to/file.pcf > /etc/vpnc/file.conf

The file.conf will look like the following:

## generated by pcf2vpnc
IPSec ID your_id
IPSec gateway xxx.xxx.xxx.xxx
IPSec secret the_secret

IKE Authmode psk

## To add your username and password,
## use the following lines:
Xauth username your_username
Xauth password your_password

Keep in mind my company is using a user:password pair, so if yours is issuing certificates the configuration for vpnc will be different from what I’m writing here.

Everything what’s left is to launch the vpnc with filename as argument:

vpnc file

And that’s all, if everything went well you should be connected to your work network! :)

Tags: , ,