Cloud-init (advanced)
This will explain how to build images in advanced mode using cloud-init as bootstrap method. This way allows to produce re-usable images for mass usage or configure your device without access to it
Using this method you need bit more technical understanding how things works, but you get get your RPI running with no keyboard or mouse or even screen available to you. We will walk you through step by step how to do this. These scripts will work with any image, which supports cloud-init. But we recommend to use Ubuntu 20.04.2 LTS image.
Close our helper scripts repository:
$ git clone https://github.com/synpse-hq/image-tools && cd image-tools
Download image into
assets/images
directory. This can be done manually or with make download-base
curl https://cdimage.ubuntu.com/releases/20.04.2/release/ubuntu-20.04.2-preinstalled-server-arm64+raspi.img.xz?_ga=2.31403323.502427891.1618417281-105156824.1616928492 -o assets/images/ubuntu-20.04.2.img.xz
Extract image so we can use it:
unxz assets/images/ubuntu-20.04.2.img.xz
Create configuration for for you local home setup:
# copy env.example fine
cp env.example env
# update env file with your configuration
export HOSTNAME=synpse
export UNIX_USER=synpse
export UNIX_PASSWORD=<unix password of you choosing>
# generate ssh key for SSH access. You can generate one by running `go run ./hack/genssh`
export SSH_KEY=$(cat ./assets/id_rsa.pub)
export LOCALE="en_US.UTF-8"
export TIMEZONE="Europe/Vilnius"
export WIFI_ACCESS_POINT_NAME="<my_awesome_wifi_ssid>"
export WIFI_ACCESS_POINT_PASSWORD="<my_awesome_wifi_password>"
# get cloud.synpse.net project_id and registration_token for device registration
export AGENT_PROJECT=prj_xxxxxxxxxxxxxxxx
export AGENT_REGISTRATION_TOKEN=drt_xxxxxxxxxxxxxxxx
Generate
cloud-init
configuration and create pre-configured image for RPI:make generate-image
Once this done you can use any existing image "burning" tools to write this image into SD card.
We recommend to use one of these:
UNetbootin - Homepage and Downloads
UNetbootin
Last modified 2yr ago