2017-03-02 14:51:53 -05:00
< h1 > Build your own kernel module< / h1 >
If your Raspberry Pi kernel is of a different version that the prebuilt modules present in this repository, here's how you can build your own.
< ol >
2017-03-02 15:56:56 -05:00
< li > We will use < a href = "https://github.com/notro/rpi-source" > rpi-source by notro< / a > to download the correct Raspberry Pi kernel source. Let's install it: < br / >
2017-03-02 14:51:53 -05:00
< code > sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source & & sudo chmod +x /usr/bin/rpi-source & & /usr/bin/rpi-source -q --tag-update< / code > < / li >
< li >
2017-03-02 15:56:56 -05:00
Now get the current kernel source: < br / >
2017-03-02 14:51:53 -05:00
< code > rpi-source< / code > < br / >
If there are errors, be sure to check < a href = "https://github.com/notro/rpi-source/wiki" > rpi-source's wiki< / a > for help
< / li >
< li >
Patch the kernel module using the patch file from my repository: < br / >
2017-03-02 15:41:15 -05:00
< code > cd ~/linux/drivers/usb/dwc2< / code > < br / >
2017-03-02 15:42:15 -05:00
< code > patch -i ~/HackPi/kernelmodules/gadget.patch< / code >
2017-03-02 14:51:53 -05:00
< / li >
< li >
Build the module: < br / >
< code > cd ~/linux< / code > < br / >
< code > make M=drivers/usb/dwc2 CONFIG_USB_DWC2=m< / code >
< / li >
2017-03-02 15:56:56 -05:00
< li > Your module < b > dwc2.ko< / b > should now be present in < code > ~/linux/drivers/usb/dwc2< / code > < / li >
2017-03-02 14:51:53 -05:00
< / ol >