RaspberryPi-Joystick icon indicating copy to clipboard operation
RaspberryPi-Joystick copied to clipboard

Fix kernel build instructions

Open gdsports opened this issue 3 years ago • 4 comments

The whole repo must be cloned. Using "--depth=1" does not work.

I helped someone setup a Pi to do kernel builds and found my instructions do not work. :(

gdsports avatar Mar 06 '21 01:03 gdsports

Worked for me on pi4. I didn't use checkout however.

milador avatar Mar 06 '21 04:03 milador

As I recall, the build worked for Pi4 but the file does not work. I had to checkout the older source code to make sure the Pi4 version of usb_f_hid.ko works. But perhaps there is a difference between building on Pi versus Ubuntu. I was cross compiling on Ubuntu but my friend wants to build on Pi. I will verify the drivers work when done. I should switch to a USB 3.0 SSD or hard drive. SD card is too slow. I can eliminate the checkout if it is not really needed.

gdsports avatar Mar 06 '21 07:03 gdsports

I can also repeat compiling again. The only change I made was changing kernel/drivers/usb/gadget/function to drivers/usb/gadget/function and it worked on Pi4. Raspberry Pi Desktop could be another option as dual boot on PC for compiling it faster. I might try that.

milador avatar Mar 06 '21 07:03 milador

Here's what I did and works well:

sudo git clone --depth=1 --branch rpi-5.10.y https://github.com/raspberrypi/linux
cd linux

made changes to f_hid.c and then:

DEST=${HOME}/RaspberryPi-Joystick/XACGamepad/Drivers
TAIL=drivers/usb/gadget/function
NUMCPU=4

and the rest is the same.

KERNEL=kernel
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
make -j ${NUMCPU} ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
DESTDIR="${DEST}/5.10.11+/${TAIL}"
...

milador avatar Mar 08 '21 04:03 milador