Skip to content

Instantly share code, notes, and snippets.

@markstinson
Forked from damoclark/raspi-config.txt
Last active August 20, 2022 16:55
Show Gist options
  • Save markstinson/17e045773eb8a4b4707694b3aa80ea7b to your computer and use it in GitHub Desktop.
Save markstinson/17e045773eb8a4b4707694b3aa80ea7b to your computer and use it in GitHub Desktop.
Simple Raspbian Configuration Tool. Add file to boot partition of SD Card and run single command after booting Raspbian.
#/bin/sh
#
# Don't change the following lines unless you know what you are doing
# They execute the config options starting with 'do_' below
grep -E -v -e '^\s*#' -e '^\s*$' <<END | \
sed -e 's/$//' -e 's/^\s*/\/usr\/bin\/raspi-config nonint /' | bash -x -
#
############# INSTRUCTIONS ###########
#
# Change following options starting with 'do_' to suit your configuration
#
# Anything after a has '#' is ignored and used for comments
#
# If on Windows, edit using Notepad++ or another editor that can save the file
# using UNIX-style line endings
#
# macOS and GNU/Linux use UNIX-style line endings - use whatever editor you like
#
# Then drop the file into the boot partition of your SD Card
#
# Additional files to create in your SD Card boot partition:
#
# * ssh.txt # this should be an empty file - it enables the ssh server
#
# * userconf.txt # starting with Bullseye, you must create a default username and passwd.
# To create userconf.txt, run the following in a bash terminal (WSL, Cygwin, any bash will do)
# Be sure to change pi:raspberry to what ever you want -- you'll need openssl installed:
#
# echo "pi:$(echo 'raspberry' | openssl passwd -6 -stdin)" > userconf.txt
#
# * wpa_supplicant.conf # this can have your WiFi creds, and skip the wifi stuff below.
# it should contain the following:
#
# country=us
# update_config=1
# ctrl_interface=/var/run/wpa_supplicant
#
# network={
# scan_ssid=1
# ssid="network_name"
# psk="password"
# }
#
# After booting the Raspberry Pi, login as user 'pi' (or whomever) and run following command:
#
# sudo /boot/raspi-config.txt
#
############# EDIT raspi-config SETTINGS BELOW ###########
# Hardware Configuration
do_boot_wait 0 # Turn on waiting for network before booting
do_boot_splash 1 # Disable the splash screen
do_overscan 1 # Disable overscan
do_camera 1 # Disable the camera
# do_ssh 0 # Enable remote ssh login, uncomment if not using the boot/ssh file
do_spi 1 # Disable spi bus
do_memory_split 16 # Set the GPU memory limit to 16, 32, or 64MB
do_i2c 1 # Enable the i2c bus
do_serial 1 # Enable the 3.3v TTL serial bus
do_boot_behavior B1 # Boot to CLI & require login
# B1 # Boot to CLI & require login
# B2 # Boot to CLI & auto login as pi user
# B3 # Boot to Graphical & require login
# B4 # Boot to Graphical & auto login as pi user
do_onewire 1 # Disable onewire on GPIO4
do_audio 0 # Auto select audio output device
# 1 # Force audio output through 3.5mm analogue jack
# 2 # Force audio output through HDMI digital interface
#do_gldriver G1 # Enable Full KMS Opengl Driver - must install deb package first
# G1 # Enable Full KMS Opengl Driver - must install deb package first
# G2 # Enable Fake KMS Opengl Driver - must install deb package first
# G3 # Disable opengl driver (default)
# do_rgpio 1 # Enable gpio server - must install deb package first
# System Configuration
do_configure_keyboard # Autodetect keyboard
do_hostname rpi # Set hostname to 'rpi'
do_change_timezone America/Chicago # Change timezone to US CST/CDT
do_change_locale en_US.UTF-8 # Set language to US English
# uncomment do_wifi stuff if not using the recommended boot/wpa_supplicant.conf
# do_wifi_country US # Set wifi country as US
# do_wifi_ssid_passphrase wifi_name password # Set wlan0 network to join 'wifi_name' network using 'password'
# Do NOT add any raspi-config configuration options after 'END' line below
# and DO NOT remove 'END' line
END
############# CUSTOM COMMANDS ###########
# You may add your own custom GNU/Linux commands below this line
# These commands will execute as the root user
# Some examples - uncomment by removing '#' in front to test/experiment
# /usr/bin/raspi-config do_wifi_ssid_passphrase # Interactively configure the wifi network
# /usr/bin/apt update # Update the software package information
# /usr/bin/apt upgrade # Upgrade installed software to the latest versions
# /usr/bin/raspi-config do_change_pass # Interactively set password for your login
# /sbin/shutdown -r now # Reboot after all changes above complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment