Building Gadget USB Module
From Openmoko
Thebohemian (Talk | contribs) (→Ubuntu Feisty 7.0.4) |
Thebohemian (Talk | contribs) (rewritten in a way that does not involve breaking the package management) |
||
Line 4: | Line 4: | ||
This procedure works on Debian GNU/Linux as well. | This procedure works on Debian GNU/Linux as well. | ||
− | == Ubuntu Feisty 7.0.4 == | + | == Debian GNU/Linux and Ubuntu Feisty 7.0.4 == |
To prepare your environment run the following: | To prepare your environment run the following: | ||
sudo apt-get install linux-source linux-headers-`uname -r` | 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) | 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 | mkdir usb_module_dir | ||
cd usb_module_dir | cd usb_module_dir | ||
− | cp -r /usr/src/linux/drivers/usb/* . | + | cp -r /usr/src/linux-source-2.6.##/drivers/usb/* . |
cd gadget | cd gadget | ||
echo "KDIR := /lib/modules/`uname -r`/build" >> Makefile | echo "KDIR := /lib/modules/`uname -r`/build" >> Makefile | ||
Line 30: | Line 27: | ||
make | 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 | + | sudo insmod ./gadgetfs.ko |
− | + | ||
− | + | ||
− | sudo | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
[[Category:Categories]] | [[Category:Categories]] | ||
[[Category:Guides]] | [[Category:Guides]] |
Revision as of 16:41, 30 July 2007
General Comments
You will most likely need kernel version 2.6.20 or higher
This procedure works on Debian GNU/Linux as well.
Debian GNU/Linux and Ubuntu Feisty 7.0.4
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