Implementing Thistle Verified Boot on Raspberry Pi 4
By the end of this guide you will have your Raspberry Pi 4 integrated with Thistle Verified Boot. This integration relies on an Infineon OPTIGA™ Trust M as the root of trust.
We recommend using our provided image as it integrates the user-land tooling for the Infineon OPTIGA Trust M, though it is not necessary for final integration.
Copy
Ask AI
# fetch and decompress image$ curl -O https://storage.googleapis.com/thistle-assets/verified-boot-demo/base-raspberrypi4-64-thistle.wic.zst$ zstd -d base-raspberrypi4-64-thistle.wic.zst$ sha256sum base-raspberrypi4-64-thistle.wic2330fb778e4431dde153197e020766bd1efbb11f449dc82681c123ab888064f1 base-raspberrypi4-64-thistle.wic# write on card. Make sure to use the correct device name for your sd card.$ sudo dd status=progress if=base-raspberrypi4-64-thistle.wic of=/dev/mmcblk0
Before booting up the image, we need to make sure the i2c_gpio module is loaded.
Copy
Ask AI
# mount boot partition and reach the boot directory$ cd /mnt/boot# amend config as follow$ cat config.txt[.. at the end of the file ..]# Enable I2C#dtparam=i2c1=on#dtparam=i2c_arm=ondtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3# Enable UARTenable_uart=1# Enable VC4 Graphicsdtoverlay=vc4-kms-v3d
It is now time to install the customised version of U-Boot on the SD card. Alongside this U-boot binary, a custom script and environment file are required, but we are not going to use these just yet.
Refer to the Overview guide to learn how to write the Trust M public key. Note that on the provided image, an additional step is required to connect to the Trust M - we need to symlink the i2c device.
The username for this image is a and the password is also a.
Now that we have the environment in place, we are ready to sign the kernel image, and test a boot sequence. You now need to sign the kernel image using the image signing tool provided on your Thistle Project, and the kernel image located on the boot partition of the SD card (kernel8.img)This file needs to be stored on the boot partition of the Raspberry Pi 4, under the name kernel-sig.
Copy
Ask AI
# mount boot partition and reach the boot directory$ cd /mnt/boot# fetch TVB enabled u-boot binary and updated uboot environment$ curl -O https://storage.googleapis.com/thistle-assets/verified-boot-demo/boot.scr$ curl -O https://storage.googleapis.com/thistle-assets/verified-boot-demo/uboot.env# copy the signature$ mv ~/Downloads/kernel-sig .
It is now time to enable verified boot by setting the verified environment variable in U-Boot.