You need to sign in before continuing.

Commit 4bdd032f5bbfcd1afff9f56c7da59effd74fbf63

Authored by Tim Gover
1 parent 58bdaf44

secure-boot BETA documentation updates

Showing 1 changed file with 18 additions and 12 deletions
Readme.md
... ... @@ -61,11 +61,11 @@ On Compute Module 4 EMMC-DISABLE / nRPIBOOT (GPIO 40) must be fitted to switch t
61 61 Otherwise, the SPI EEPROM bootloader image will be loaded instead.
62 62  
63 63 <a name="secure-boot"></a>
64   -## Secure Boot
65   -TODO - Add link to whitepaper / user-guide
  64 +## Secure Boot - BETA
  65 +Secure Boot is currently a BETA release feature and the functionality to permanently enable secure-boot via OTP is not enabled in this release.
66 66  
67 67 ### Host setup
68   -Secure boot require a 2048 bit RSA asymettric keypair and the Python `pycrytodomex` module to sign the EEPROM config and boot image.
  68 +Secure boot require a 2048 bit RSA asymmetric keypair and the Python `pycrytodomex` module to sign the EEPROM config and boot image.
69 69  
70 70 #### Install Python Crypto support (the pycryptodomex module)
71 71 ```bash
... ... @@ -90,24 +90,28 @@ must be placed in the boot partition of the Raspberry Pi.
90 90  
91 91 The contents of the boot.img are the files normally present in the Raspberry Pi OS boot
92 92 partition i.e. firmware, DTBs and kernel image. However, in order to reduce boot time
93   -it is advisible to remove unused files e.g. firmware or kernel images for Pi models.
  93 +it is advisable to remove unused files e.g. firmware or kernel images for Pi models.
94 94  
95   -The firmware must be new enough to support secure boot. Either download the latest
96   -Raspberry Pi OS Bullseye OS image or alternateively, download the files
97   -for the `raspberrypi-bootloader` APT package directly from Github and use the files
98   -in the `boot` directory.
  95 +The firmware must be new enough to support secure boot. The latest firmware APT
  96 +package supports secure boot. To download the firmware files directly.
99 97  
100 98 `git clone --depth 1 --branch stable https://github.com/raspberrypi/firmware`
101 99  
102 100 A helper script (`make-boot-image`) is provided to automate the image creation process. This
103   -script depends upon the mkfs.fat and udisksctl tools and only runs on Linux.
  101 +script depends upon the `mkfs.fat` and `losetup` tools and only runs on Linux.
104 102  
105 103 #### Clone the Raspberry Pi OS boot files
106 104 Copy the contents of `/boot` to a local directory called `secure-boot-files`
107 105  
108 106 #### Set the kernel root device
109   -Verify that `cmdline.txt` in `secure-boot-files` points to the correct device for the root file-system.
110   -e.g. `root=/dev/mmcblk0p2` for the normal partition on CM4 EMMC.
  107 +Since the boot filesystem for the firmware is now in a signed disk image the OS cannot write to this.
  108 +Therefore, any changes to `cmdline.txt` must be made before the `boot.img` file is signed.
  109 +
  110 +* Verify that `cmdline.txt` in `secure-boot-files` points to the correct UUID for the root file-system.
  111 + Alternatively, for testing, you can specify the root device name e.g. `root=/dev/mmcblk0p2`.
  112 +
  113 +* Remove `init-resize.sh` from `cmdline.txt`
  114 +
111 115  
112 116 #### Create the boot image
113 117 The `-p` product argument (pi4,pi400,cm4) tells the script to discard files which are not required by that product. This makes the image smaller and reduces the time taken to calculate the hash of the image file thereby reducing the boot time.
... ... @@ -115,12 +119,14 @@ The `-p` product argument (pi4,pi400,cm4) tells the script to discard files whic
115 119 sudo ../tools/make-boot-image -d secure-boot-files -o boot.img -p pi4
116 120 ```
117 121  
  122 +The maximum supported size for boot.img is currently 64 megabytes.
  123 +
118 124 #### Sign the boot image
119 125 ```bash
120 126 ../tools/rpi-eeprom-digest -i boot.img -o boot.sig -k "${KEY_FILE}"
121 127 ```
122 128  
123   -#### Copy the secure boot image to the device boot filesystem
  129 +#### Copy the secure boot image to the boot partition on the Raspberry Pi.
124 130 Copy `boot.img` and `boot.sig` to the chosen boot filesystem. Secure boot images can be loaded from any of the normal boot devices (e.g. SD, USB, Network).
125 131  
126 132 ### Raspberry Pi Imager - BETA
... ...