View source for Building Gadget USB Module
From Openmoko
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Template used on this page:
Return to Building Gadget USB Module.
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page:
Template used on this page:
Return to Building Gadget USB Module.
The guide is currently valid for Debian-based distros. Feel free to add instructions for others as well.
You will most likely need kernel version 2.6.20 (>= Debian Lenny & Ubuntu Feisty Fawn) or higher
To prepare your environment run the following:
sudo apt-get install linux-source linux-headers-`uname -r`
Create and enter working dir (e.g. ~/gadgetfs)
mkdir $WD cd $WD
Uncompress /usr/src/linux-source-2.6.##.tar.gz (or .bz2)
tar xf /usr/src/linux-source-2.6.##.tar.gz
Then run the following:
mkdir usb_module_dir cd usb_module_dir cp -r /usr/src/linux-source-2.6.##/drivers/usb/* . cd gadget echo "KDIR := /lib/modules/`uname -r`/build" >> Makefile echo "PWD := `pwd`" >> Makefile echo "obj-m := dummy_hcd.o gadgetfs.o" >> Makefile echo "default: " >> Makefile echo -e "\t\$(MAKE) -C \$(KDIR) SUBDIRS=\$(PWD) modules" >> Makefile make
If everything went fine you will find dummy_hcd.ko and gadgetfs.o along with other files in the current directory. Load the modules whenever you need them by issuing
sudo insmod ./dummcy_hcd.ko sudo insmod ./gadgetfs.ko