Markus Niemistö
2008-03-22 12:12:47 UTC
Hi list,
I was trying to get synce to work with my WM6 PDA and FreeBSD 7 the other day.
There was a few things I had to do. With the attached patches I am able to
sync and access my device using palm/uppc-kmod driver from FreeBSD ports. I
also used old opensync 0.22 framework. Of course I had to disable the
Advanged network functionality on my PDA.
The first patch, hal-freebsd.patch, addresses a few FreeBSD specific hal DCCM
issues. First, linux/if.h header doesn't exist on other platforms. I think
net/if.h should work on Linux too, but I ifdef'd it just in case. Second
issues was that usb-rndis-ng rule in 10-synce.fdi created some conflicts so I
removed it. I also tried to make the FreeBSD ucom rule more general. Then I
made some adjustments for hal-synce-legacy script. There were few other
things I noticed: device file handling did not work at all on FreeBSD,
FreeBSD ppp doesn't support linkname, and last, at least on my computer, HAL
0.5.11rc2 doesn't set environmental variable HALD_ACTION. HAL also searches
the scripts only from $prefix/libexec so I adjusted the Makefile accordingly.
The second patch, sync-engine-hal.patch, adds support for HAL DCCM for
sync-engine. In addition to that it also fixes scripts list_partnerships.py,
create_partnership.py and clean_partnerships.py. The first two scripts were
using wrong (non existing) exception classes and the third was passing too
few parameters.
The third issue the second patch fixes is something I had quite hard time to
figure out. It seems that rapi contexts are created and stored into TLS so
they are per thread. So when the rapi context is created in main thread in
kernel.py and used later in another thread in synchandler.py, librapi method
rapi_context_current() returns new, uninitialized context, that results in
sync-engine crash. I fixed this by creating and using a new rapi context in
SyncHandler.run() method. This makes the thing work.
At least hal-synce-legacy and 10-synce.fdi need some work to be platform
independet, but now the thing works on FreeBSD. I hope these patches are
useful and fixes get commited. At least sync-engine TLS issue should also be
there on other platforms too.
Thanks,
Markus Niemistö
I was trying to get synce to work with my WM6 PDA and FreeBSD 7 the other day.
There was a few things I had to do. With the attached patches I am able to
sync and access my device using palm/uppc-kmod driver from FreeBSD ports. I
also used old opensync 0.22 framework. Of course I had to disable the
Advanged network functionality on my PDA.
The first patch, hal-freebsd.patch, addresses a few FreeBSD specific hal DCCM
issues. First, linux/if.h header doesn't exist on other platforms. I think
net/if.h should work on Linux too, but I ifdef'd it just in case. Second
issues was that usb-rndis-ng rule in 10-synce.fdi created some conflicts so I
removed it. I also tried to make the FreeBSD ucom rule more general. Then I
made some adjustments for hal-synce-legacy script. There were few other
things I noticed: device file handling did not work at all on FreeBSD,
FreeBSD ppp doesn't support linkname, and last, at least on my computer, HAL
0.5.11rc2 doesn't set environmental variable HALD_ACTION. HAL also searches
the scripts only from $prefix/libexec so I adjusted the Makefile accordingly.
The second patch, sync-engine-hal.patch, adds support for HAL DCCM for
sync-engine. In addition to that it also fixes scripts list_partnerships.py,
create_partnership.py and clean_partnerships.py. The first two scripts were
using wrong (non existing) exception classes and the third was passing too
few parameters.
The third issue the second patch fixes is something I had quite hard time to
figure out. It seems that rapi contexts are created and stored into TLS so
they are per thread. So when the rapi context is created in main thread in
kernel.py and used later in another thread in synchandler.py, librapi method
rapi_context_current() returns new, uninitialized context, that results in
sync-engine crash. I fixed this by creating and using a new rapi context in
SyncHandler.run() method. This makes the thing work.
At least hal-synce-legacy and 10-synce.fdi need some work to be platform
independet, but now the thing works on FreeBSD. I hope these patches are
useful and fixes get commited. At least sync-engine TLS issue should also be
there on other platforms too.
Thanks,
Markus Niemistö