A small python based initialization tool to kickstart Raspberry Pi configuration.
The main aim for this tool is to automate configuration steps that I usually take, everytime I set up a new Raspberry Pi. I hope it helps you too.
This tool needs python3 installed.
- Clone this repository
- Change the settings you need in the config.json, remove the settings you don't want to configure from it. (In case you screw up, there is a copy under config.json.default)
- Run the tool using the following command
sudo ./configure
{
"hostname": "newhostname",
"swap_mb": 1024,
"expand_fs": true,
"wifi_settings": {
"country": "CH",
"ssid": "mywifiname",
"psk": "mywifipassword"
},
"network_config": [
{
"interface": "eth0",
"ip_address": "192.168.1.105/24",
"routers": "192.168.1.1",
"domain_name_servers": ["8.8.8.8", "8.8.4.4"]
},
{
"interface": "wlan0",
"ip_address": "192.168.1.106/24",
"routers": "192.168.1.1",
"domain_name_servers": ["8.8.8.8", "8.8.4.4"]
}
],
"set_locale_en_us": true,
"reduce_journald_size": true,
"new_user_password": "newpassword",
"disable_password_login": false,
"update_packages": true
}
type: string
New hostname to set.
type: int
Change size of swap (default: 100).
type: bool
Expand root filesystem /
.
value | type |
---|---|
country | string |
ssid | string |
psk | string |
Configuring the wifi of your Raspberry Pi.
- For the right value of
country
find the correct alpha-2 code here.
value | type |
---|---|
interface | string |
ip_address | string |
routers | string |
domain_name_servers | List[string] |
Configuring static IP addresses on your Raspberry Pi.
- For the right value of
interface
seeifconfig
-command. - Write
ip_address
in CIDR-format including subnet information.
type: bool
Setting the locale settings to en_us (default: en_gb)
type: bool
Configuring journald to only use 50MB of storage.
type: str
Changing the password of the pi
user.
type: bool
Disabling the password login for the pi
user. Only possible if /home/pi/.ssh/authorized_keys
file exists and is not empty. Does overwrite the new_password
parameter.
type: bool
Updates all the packages installed after reboot. This copies a script to /home/pi/temp/updating
and runs it using the /etc/rc.local
after the first reboot.