Skip to content

Instantly share code, notes, and snippets.

@OnkelDom
Last active September 19, 2021 18:56
Show Gist options
  • Save OnkelDom/4af09a2880968367f14c1f8c1ba924c1 to your computer and use it in GitHub Desktop.
Save OnkelDom/4af09a2880968367f14c1f8c1ba924c1 to your computer and use it in GitHub Desktop.

Download Image From the following URL

Lite Version

https://downloads.raspberrypi.org/raspios_lite_arm64/images/

Full OS (With GUI)

https://downloads.raspberrypi.org/raspios_arm64/images/

Prepare SD Card with Balena Etcher

Download Balencer Etcher and Install SD-Card with this

https://www.balena.io/etcher/

Configureation on /boot Device on SD Card

Create a empty file ssh to enable the ssh deamon on boot

Create a file called wpa_supplicant.conf in the folder and add the follow content to enable an connect wifi.

Before we do this, you must first work out the 2 letter ISO 3166-1 country code.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=[WIFI COUNTRY CODE]

network={
 ssid="[NETWORK SSID]"
 psk="[NETWORK PASSWORD]"
}

Disable and Remove SWAP on Raspberry PI

sudo dphys-swapfile swapoff
sudo dphys-swapfile uninstall
sudo update-rc.d dphys-swapfile remove
sudo apt purge dphys-swapfile

Change SWAP to ZRAM

# remove the old dphys version
$ sudo /etc/init.d/dphys-swapfile stop
$ sudo apt-get remove --purge dphys-swapfile
# install zram
$ sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/zram.sh
# set autoload
$ sudo vi /etc/rc.local
# add the next line before exit 0
/usr/bin/zram.sh &
$ sudo chmod +x /usr/bin/zram.sh
$ sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment