Introduction
The setup described below uses the tool edi and the configuration edi-pi to generate the following artifacts on a Ubuntu or Debian host machine:
- A Debian bullseye arm64 (64bit) image suitable for the Raspberry Pi 4.
- A matching Mender update artifact for the above configuration.
- An amd64/arm64 based LXD container with a pre-installed cross development toolchain for C and C++.
Building the Artifacts
Preparation
Prior to using the edi-pi configuration you have to install edi according to this instructions. Please take a careful look at the “Setting up ssh Keys” section since you will need a proper ssh key setup in order to access the Rasperry Pi using ssh.
The image processing steps require some additional tools. On Ubuntu 20.04 those tools can be installed as follows:
sudo apt install e2fsprogs dosfstools bmap-tools mtools parted rsync zerofree python3-sphinx mender-artifact
Now you can clone the edi-pi
project configuration repository from GitHub:
git clone https://github.com/lueschem/edi-pi.git
cd edi-pi
Mender Configuration
To get connected to your tenant you have to add your tenant token to your image build:
vi configuration/mender/mender.yml
Please enter your tenant token like this:
mender_tenant_token: YOURTENANTTOKENRETRIEVEDFROMHOSTEDMENDER
Creating the Artifacts
A Raspberry Pi image and a Mender update artifact can be created using the following command:
sudo edi -v image create pi4-bullseye-arm64.yml
Please upgrade your Raspberry Pi 4 EEPROM prior to using the just created artifacts!
The resulting image can be copied to a SD card (here /dev/mmcblk0) using the following command (Please note that everything on the SD card will be erased!):
sudo bmaptool copy artifacts/pi4-bullseye-arm64.img /dev/mmcblk0
If the command fails, unmount the flash card and repeat the above command.
Once you have booted the Raspberry Pi using this SD card you can access it using ssh (the access should be granted thanks to to your ssh keys):
ssh pi@IP_ADDRESS
The password for the user pi is raspberry (just in case you want to execute a command using sudo
or login via a local terminal).
The Mender update artifacts can be found in the same artifacts
folder like the the full images.
More Information
For more information please read the edi documentation and this blog post.
For more details about the Mender integration please refer to this blog post.
If you are curious about the bootloader setup please take a look at this blog post.