- ダウンロードしたRaspberry Pi OSを用意する
- ここにあるegnerate-userconf.sh の NEW_USERNAME, NEW_PASSWORDを書き換えて実行する(要Docker)
- 表示された -- /boot/userconf.txt の次の行を bootパーティションに userconf.txt として保存する
- bootパーティションの config.txt の末尾に
dtoverlay=pi3-miniuart-bt
を追記する - シリアル接続して起動する
Last active
May 15, 2023 21:25
-
-
Save mamemomonga/b17b60e9378e8a732b97e009fa929284 to your computer and use it in GitHub Desktop.
Raspberry Pi OS 初期設定メモ
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 | |
set -eu | |
NEW_USERNAME="newuser" | |
NEW_PASSWORD="newpass" | |
docker run --rm -e "NEW_USERNAME=$NEW_USERNAME" -e "NEW_PASSWORD=$NEW_PASSWORD" -i debian bash << 'EOS' | |
apt-get update | |
apt-get install -y openssl | |
echo "USERNAME: $NEW_USERNAME" | |
ENC_PASSWORD="$(echo "$NEW_PASSWORD" | openssl passwd -6 -stdin)" | |
echo "" | |
echo "" | |
echo "-- /boot/userconf.txt" | |
echo "$NEW_USERNAME:$ENC_PASSWORD" | |
EOS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment