Turning your Raspberry Pi Zero into a USB Gadget
last major update April 22, 2024
Old Kernel Install
and rename itgadgetkernel.tgz
Step 1. Copy New Kernel to SD Card
Copy the new kernel file over to theboot directory of the Jessie Lite card. After you're done burning the SD image, don't eject it just yet. Drag thekernel.tgz file over to the SD card. This way you can ferry the kernel into your Pi without needing network
Step 2. Log into your Pi Zero
Insert the SD into your Pi Zero, connect the console cable, power the Pi & log into via the USB console.
Step 3. Uncompress new kernel package
Uncompress and install thekernel .tgz file
run the following commands:
- cd ~
- sudo mv /boot/gadgetkernel.tgz .
- tar -xvzf gadgetkernel.tgz
You'll see a long stream of file names ending withtmp/boot/kernel.img
Step 4. Backup and Install new Kernel
Run
- sudo mv /boot/kernel.img /boot/kernelbackup.img
to make a backup of the current kernel. Now run
- sudo mv tmp/boot/kernel.img /boot
You may see complaints about preserving ownership, you can ignore them
Step 5. Install Overlays & Modules
Run the commands to install the new overlays & modules
- sudo mv tmp/boot/overlays/* /boot/overlays
- sudo mv tmp/boot/*dtb /boot
- sudo cp -R tmp/boot/modules/lib/* /lib
Gadget Serial!
Now we'll tell the Pi we want to use theg_serial module
Run
- sudo nano /etc/modules
and addg_serial on a single line at the end, then save
Gadget Ethernet!
Now we'll tell the Pi we want to use theg_ether module
Run
- sudo nano /etc/modules
and addg_ether on a single line at the end, then save
Page last edited August 21, 2016
Text editor powered bytinymce.