http://prdownloads.sourceforge.net/lufs/lufs-0.9.6.tar.gz?download
[lufs.git] / docs / cefs.txt
1 This is a LUFS filesystem module allowing to access the filesystem of
2 a Windows CE device (HP (Compaq) Ipaq, HP Jornada, etc...)
3
4 Because of limitations of the current version of librapi not all
5 filesystem operations are supported.  Specifically, file read and
6 write are performed only at file open and file close.  Opening files
7 in read-write mode is not supported.
8
9 This code uses librapi library from the SynCE project.  For
10 convenience asyncd source code from that project is also included in
11 this distribution.
12
13         http://synce.sourceforge.org
14
15 SOURCES OF ADDITIONAL INFORMATION
16
17         http://synce.sourceforge.org
18         http://www.handhelds.org
19
20 REQUIREMENS
21
22 A Windows CE device :)
23
24 INSTALLATION
25
26 To use the CEFS module you should be able to connect your Windows CE
27 device to the Linux box using serial cable, USB, or IRDA.
28
29 Here I give some explanations of how to setup the connection between
30 the Linux box and PDA.  It is described in many places, so you may
31 find it interesting to compare the description here with bits of
32 information you can read on http://synce.sourceforge.org
33 http://www.handhelds.org and in Documentation/usb/usb-serial.txt in
34 the kernel source.
35
36
37 I. Asyncd setup
38
39 In any case you should setup asyncd -- a daemon to keep the connection
40 up.  Notice, that if you protected you Windows CE device with a
41 password (which is generally quite a good idea), you should change it
42 from the default value "1234" in asyncd.c recompile and reinstall
43 asyncd.  Long passwords are not supported now.
44
45 1) add the following line to /etc/services :
46
47 dccm          5679/tcp                        # ActiveSync KeepAlive
48
49 2) configure your Inetd super-daemon (either inetd, or xinetd), so that client/asyncd is
50  fired whenever someone initiates a TCP connect on port 5679 on your
51  computer (insert the prefix you used in ./configure instead of the default /usr/local):
52
53 * inetd : add the following line to /etc/inetd.conf
54 -------------------------------------------------------------
55 asyncd      stream  tcp     nowait  lufs    /usr/local/bin/asyncd asyncd
56 -------------------------------------------------------------
57
58 * xinetd : add the following file (asyncd) to /etc/xinetd.d :
59 -------------------------------------------------------------
60 # default: on
61 service asyncd
62 {
63     flags           = REUSE NOLIBWRAP
64     socket_type     = stream
65     wait            = no
66     user            = lufs
67     server          = /usr/local/bin/asyncd
68     log_on_failure  += USERID
69     only_from       = 127.0.0.1 192.168.131.0/24
70     disable         = no
71 }
72 -------------------------------------------------------------
73
74 (xinetd : replace the line 'only_from' with your local network mask (the one where your
75 CE device will be calling from, or disable it completly)
76
77
78 II. Physical link setup
79
80 II.A Serial link setup.
81
82 Here you have a lot of variants.  The simplest is:
83
84 Variant 1.
85
86 Create the following file (cedevice) in /etc/ppp/peers :
87 -------------------------------------------------------------
88 /dev/ttyS1 115200 modem
89 connect '/usr/sbin/chat -v CLIENT "CLIENT\c" "" "SERVER\c"'
90 noauth
91 local
92 192.168.131.102:192.168.131.201
93 ms-dns 192.168.131.102
94 lcp-echo-failure 2
95 lcp-echo-interval 2
96 linkname cedevice
97 -------------------------------------------------------------
98
99 To start the communications you'll have to run (as root):
100
101 $ pppd call cedevice
102
103 This should start your Windows CE device, and start a PPP link.
104 Check that your PPP configuration shows the link, and check that 'asyncd' has
105 created a file '/tmp/cedevice' which contains the informations on your device (
106 IP address, brand, etc...)
107
108
109 Variant 2.
110
111 As an alternative method you can use mgetty to automatically start the
112 link on connection of your PDA to the computer.  It is a very simple
113 setup, assuming that you don't have dialin connections.
114
115 Add the following lines to /etc/mgetty+sendfax/mgetty.config:
116 ------------------------------------------------------------------------
117 # WinCE connection: port ttyS1
118   speed 115200
119   direct y
120   toggle-dtr n
121   issue-file /etc/ppp/wince.issue
122 ------------------------------------------------------------------------
123 Add this to /etc/mgetty+sendfax/login.config:
124 ------------------------------------------------------------------------
125 # This is for WinCE
126 /AutoPPP/ -    a_ppp   /usr/sbin/pppd file /etc/ppp/wince
127 ------------------------------------------------------------------------
128 Create the file /etc/ppp/wince.issue:
129 ------------------------------------------------------------------------
130 CLIENTSERVER
131 CLIENTSERVER
132 CLIENTSERVER
133 ------------------------------------------------------------------------
134 and the file /etc/ppp/wince:
135 ------------------------------------------------------------------------
136 modem
137 noauth
138 local
139 192.168.131.102:192.168.131.201
140 ms-dns 192.168.131.102
141 lcp-echo-failure 2
142 lcp-echo-interval 2
143 linkname cedevice
144 ------------------------------------------------------------------------
145
146
147 II.B. USB Setup.
148
149 If you have an old kernel, you can try to use ipaqd from SynCE
150 project.  Here I'll describe usage if ipaq module present in kernel
151 (starting at least from 2.4.18 ar maybe earlier).  Generally, you
152 should first look at the file Documentation/usb/usb-serial.txt in your
153 kernel source.  BUT: Don't believe the words written there abut uhci.o
154 and usb-uhci.o modules.  In my case it works _only_ with usb-uhci and
155 does not work at all with uhci.  Maybe in some cases opposite is
156 better, I don't know.
157
158 Also you shold make a special version of chat.  To get it, recompile
159 the ppp distribution after applying the patch ppp-chat.patch in the
160 'other' directory.  This will make the chat program which does not
161 make intercharacter delay.  For some reason In my case it is crucially
162 needed to make things work.  Maybe it is not always the case, so you
163 may try first without this, and do this only if your PDA freezes
164 during establishing connection with the computer.  Another patch that
165 was needed in my case is ppp-pppd.patch, which _adds_ some delay
166 between ppp control packets.  It is really a patch that I don't
167 understand, but it helped in my case.
168
169 You should install hotplug, to use USB.  Here I give an example setup.
170 Create the file /etc/hotplug/usb/ipaq:
171 ------------------------------------------------------------------------
172 #!/bin/bash echo $REMOVER created >>/tmp/ipaqlog cat >$REMOVER
173 <<-'EOF'
174         #!/bin/sh
175         if [ -f /var/lock/LCK..ttyUSB0 ]
176         then
177             kill -9 `cat /var/lock/LCK..ttyUSB0`
178         fi
179 EOF
180 chmod a+x $REMOVER
181 MYIP=192.168.131.102
182 REMOTEIP=192.168.131.201
183 MYDNS=192.168.131.102
184
185 if [ -f /var/lock/LCK..ttyUSB0 ]
186 then
187     kill -9 `cat /var/lock/LCK..ttyUSB0`
188 fi
189 /usr/sbin/pppd.ipaq /dev/ttyUSB0 \
190         connect "/usr/sbin/chat.nopause -v TIMEOUT 60 CLIENT 'CLIENTSERVER\c'" \
191         nocrtscts local passive $MYIP:$REMOTEIP ms-dns $MYDNS noauth
192 -----------------------------------------------------------------------
193 And apply the following patch to /etc/hotplug/usb.agent
194 ------------------------------------------------------------------------
195 --- /home/fedor/usb.agent       Mon Sep 23 00:28:48 2002
196 +++ /etc/hotplug/usb.agent      Thu Apr 11 10:38:36 2002
197 @@ -298,6 +298,15 @@
198         rm -f "$REMOVER"
199      fi
200  
201 +    if [ "$PRODUCT" = "49f/3/0" ]; then   # Compaq Ipaq 3760
202 +        /etc/hotplug/usb/ipaq
203 +        exit 0
204 +    fi
205 +    if [ "$PRODUCT" = "3f0/1116/0" ]; then # HP Jornada 568
206 +        /etc/hotplug/usb/ipaq
207 +        exit 0
208 +    fi
209 +
210      # on 2.4 systems, modutils 2.4.2+ maintains MAP_CURRENT
211      # ... otherwise we can't rely on it (sigh)
212      case "$KERNEL" in
213 ________________________________________________________________________
214
215
216 II.C IRDA Setup
217
218 To be written.  But it works, it was checked.  Ask, if you are interested.
219
220
221 III lufs setup
222
223 Nothing additional to general lufs setup!
224
225
226 USAGE
227
228 Simply mount the filesystem after connecting your PDA with a command
229 like
230
231         mount -t lufs -o fs=cefs none /mnt/lufs
232
233 No additional options, instead of general LuFS options uid, gid, fmask
234 and dmask are present.
235
236 And umount it before disconnecting.  It may be a good idea to setup
237 automounter to do this.
238
239
240 Fedor Bezrukov
241 <fedor@ms2.inr.ac.ru>