Last active
June 9, 2019 07:19
-
-
Save gnue/a58a43943a80c55db6d2d7c950d989ad to your computer and use it in GitHub Desktop.
Raspberry Pi を USB-Ethernetデバイスで使えるように boot ボリュームを書き換える
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for macOS | |
cd /Volumes/boot | |
dtoverlay="dtoverlay=dwc2" | |
module_load="modules-load=dwc2,g_ether" | |
if [ -z $(grep "^$dtoverlay$" config.txt 2>/dev/null) ]; then | |
echo "$dtoverlay" | tee -a config.txt | |
fi | |
if [[ -z $(grep "$module_load" cmdline.txt 2>/dev/null) ]]; then | |
echo "$module_load" | |
sed -i.bak "s/rootwait/rootwait $module_load/" cmdline.txt | |
fi | |
touch ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
macOS用なので
cd /Volumes/boot
しています。他の環境で使う場合は boot ボリュームのマウントポイントに合わせて変更して下さい。