Once you've done this, cross your fingers, hold your breath, and
reboot.
## Testing Upgrades
### arm64
To overwrite *only the normal-boot image* on the `kevin` arm64
platform, use the following commands:
```
flashrom -p linux_mtd --fmap -i NORMAL -w coreboot.rom
```
The command above tells flashrom to read the "fmap descriptor" from
the chip before writing. An "fmap descriptor" is basically the flash
chip equivalent of a partition table. The `-i NORMAL` tells it to
read the `NORMAL` partition out of the `coreboot.rom` image and write
it to the `NORMAL` partition on your flash chip.
### amd64
AMD platforms require a rather unusual fmap descriptor format, with
nested partitions. This is needed for the AMD-supplied AEGSA code
(which is open source, but fragile enough that issues like this tend
to be worked around rather than fixed), which uses the outer partition
for SMRAM protection (a critical security requirement). Unfortunately
flashrom gets confused by these nested partition tables, so on that
platform you need to pass the partition table to flashrom explicitly,
in a format it understands, and with the outer partitions omitted. To
do this, execute the following command:
```
flashrom -p internal --layout result/flashrom.layout -i NORMAL -w result/coreboot.rom
```
## Accepting Upgrades
If all went well, you can write the now-known-good image to your
`FALLBACK` partition by using the same commands above, but replacing
`NORMAL` with `FALLBACK`.
## Recovery
If you flash a bad `NORMAL` image, you can switch to the `FALLBACK`
image several ways:
# arm64
Eject the stylus pen from the laptop and pull it all the way out before powering on the device. There is an internal sensor that detects if the stylus is inserted or not; ownerboot checks this sensor very early in the boot process.
You can also use the watchdog reboot to select the `FALLBACK` image; ownerboot examines the "reboot reason" register early in the boot process and takes it into account when selecting an image:
```
cat > /dev/watchdog # will block for a while, then hard reboot
```
# amd64
Connect the two motherboard pins designated as the "recovery jumper" before powering the machine on. I have these pins wired to the power switch on the front of my servers' chassis so I can use the power button as a recovery button.
You can also use the RTC NVRAM to force a `FALLBACK` image boot. The first command below selects the `Fallback` image; the second command reads back the value written so you can confirm that it was stored correctly.