Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save charlieporth1/af6a356f28b9fb0ac1224491490c8558 to your computer and use it in GitHub Desktop.
Save charlieporth1/af6a356f28b9fb0ac1224491490c8558 to your computer and use it in GitHub Desktop.
Raspberry Pi Zero SD CARD Ethernet USB gadget Setup bash script
#!/bin/bash
# Change this to your needs. I happen to be on a Macbook Pro
DRIVE_DIR=/Volumes
BOOT_DIR=boot
SD_CARD_DIR=$DRIVE_DIR/$BOOT_DIR
touch $SD_CARD_DIR/ssh
echo "dtoverlay=dwc2" | tee -a $SD_CARD_DIR/config.txt
sed "s/rootwait/rootwait modules-load=dwc2,g_ether/g" $SD_CARD_DIR/cmdline.txt > $SD_CARD_DIR/cmdline.txt.tmp
mv $SD_CARD_DIR/cmdline.txt.tmp $SD_CARD_DIR/cmdline.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment