2015年3月30日月曜日

Scripts to test

- use locally compiled objects in a tree.
- allow to test without 'make install'.
- only bus-id is needed to be specified to test.
- other options and arguments are pre-set. 

download (  application side |  device side )

app: on application side computer
dev: on device side computer
both: both of them

0) Modify settings.sh first (both)
DIR
Top directory of kernel source which includes compiled objects.
SVR
Address of a server.
PORT
TCP port number of a server.
SSL_FLG
Whether to use SSL.
WS_FLG
Whether to use WebSocket.
PROXY_FLG
Whether to use proxy.
PROXY_URL
URL of HTTP proxy.
DBG_FLG
Enables debug for tools.
DBG_FLGS
Debug flags for kernel modules.

1) Create self signed certificate files if use SSL (OPTIONAL)
both:$ ./cert_create.sh

2) Insert kernel modules
TCP in kernel mode
both:# ./insmod_kx.sh
TCP in user mode
both:# ./insmod_ux.sh

3a) Attach from application side
dev:# ./usbipd.sh
- start daemon
dev:# ./usbip_list.sh
- list local devices
dev:# ./usbip_bind.sh <bis-id>
- bind a device
app:# ./usbip_list.sh
- list attachable devices at remote
app:# ./usbip_attach.sh <bus-id>
- attach a device
app:# ./usbip_port.sh
- list attached devices
app:# ./usbip_detach.sh <port-nr>
- detach the device
dev:# ./usbip_unbind.sh <bus-id>
- unbind the device

3b) Connect from device side
app:# ./usbipa.sh
- start daemon
dev:# ./usbip_list.sh
- list local devices
dev:# ./usbip_connect.sh <bis-id>
- connect a device to remote
dev:# ./usbip_disconnect.sh <bus-id>
- disconnect the device from remote
4) Remove kernel modules
# ./rmmod.sh

NOTE: using userspace transfer mode, attach and connect will continue runnning and not return. Pleae use other window to detach or disconnect.

Scripts to patch and make locally

Scripts to patch and make locally for test.
- applies all patches in a directory.
- makes only USB/IP related objects in their directory.
- allows to test without kernel build and 'make install'.
- scripts in usbip-scripts-app/dev use these objects to test.

download

1) Apply USB/IP pathces

$ cd <top-of-kernel-tree>
eg. $ cd ~/linux-4.0-rc4-test

$ ~/usbip-scripts-make/patch_all.sh [ patches-dir ]
All pacth files in <patches-dir> will be applied.
Default <patches-dir> is assumed ~/usbip-patches/<kernel-version>.
eg. ~/usbip-patches/4.0-rc4

patch_some.sh applies some patches in in <patches-dir>.
Needs to edit the script to modify patches to be used.

2) Make locally

Only make USB/IP related objects.

$ cd <top-of-kernel-tree>
eg. $ cd ~/linux-4.0-rc4-test

$ ~/usbip-scripts-make/test_make.sh
Makefile of driver will be replaced by Makefile-kx/ux.

3) Cleanup

$ cd <top-of-kernel-tree>
eg. $ cd ~/linux-4.0-rc4-test

$ ~/usbip-scripts-make/test_clean.sh
Original drivers' Makefile is restored.

//