Flashing to Byzantium

Just flashed my Amber Librem 5 to Byzantium with LUKS encryption.

Here is a summary of some points that it took me some time to gather together. None of this is really new information. I just thought it would be good to put it all in one post. Most of this has been covered in this thread or elsewhere on this forum already.

General points

Flashing with LUKS encryption

  • When flashing using the librem5-flash-image script, remember to specify --variant luks if you want LUKS encryption.
  • It’s known that flashing the LUKS image results in an insecure cloned master key for the encryption. This is not the encryption passphrase. The passphrase can be easily changed (and indeed you can have more than one passphrase at a time), but the master key can’t be changed without re-writing all the encrypted data on disk, and you can’t do that while the encrypted filesystem is mounted, so it’s best done before flashing the image.
  • I first ran the librem5-flash-image script with --skip-cleanup to obtain the image and a uuu script (.lst file).
  • To re-encrypt with a new master key, I mapped the image as a loop device and ran cryptsetup-reencrypt on it. (References: 1, 2)
  • The re-encrypted image can then be flashed by running uuu directly, giving uuu the path to the uuu script as its only argument.
  • The encrypted image does not expand to fill the available space by default. I used cfdisk on the phone to delete /dev/mmcblk0p2 and to make a new partition filling the space. Then I deleted /etc/resize_rootfs-resized and rebooted the phone. This caused the partition to be resized to fill the available space. (References: 1, 2)

My first impression is that Byzantium seems more polished and complete than Amber. I now need to restore my data and selected configurations before trying it out properly.

9 Likes