Root on luks on arm (pinebook pro)

Hi,

I’m trying to migrate my pinebook pro from postmarketOS to nixos and am experiencing some hiccups when root is on an encrypted partition where nixos will not prompt for decryption passphrase and hang on a black screen.

I’ve flashed the recommended tow-boot to SPI so am able to boot from emmc, SD and USB easily. My goal is to have the OS on the emmc to free up the SD slot.

I’ve tried (variations of) two routes and neither have worked:

  • Flash a microSD with the sd image, boot from this
  • setup either wpa_cli or USB tethering for Internets
  • Manually partition the emmc with btrfs on luks with subvolumes and a separate swap partition, mount on /mnt and appropriate places
  • nixos-generate-config --root /mnt
  • copy my configuration.nix over
  • nixos-install --root /mnt -I nixpkgs=channel:nixos-unstable
  • reboot after install

The -I flag was needed since the installer couldn’t find nixpkgs

Eject SD card when the device is off and boot from emmc
Tow boot correctly sees nixos through extlinux and I can see the nixos generations increase with changes to the config, however after selecting an option to boot I am left on black forever.

I’ve also tried disko-install and disko + generate config, either way initrd seems to be registered with extlinux properly but get stuck when moving to boot root

The other route was using the iso installer from a USB but for some reason I am unable to find the emmc when booted into the graphical installer.

Next step will be to add plymouth to my config and of that doesn’t work, to install to sd from the GUI installer then dd the partitions over if booting works

postmarketOS has a nice GUI passphrase prompt so I know it’s possible on this hardware

Anyone have experience with the quirks of rk3399 and luks?

Some progress(?):

It seems the GUI installer “recognises” the internal eMMC but enumerates it incorrectly:

The emmc always shows up as /dev/mmcblk2 when booted into the minimal iso (also with previous OSs I have used) but with the GUI installer it shows up as mmcblk0. This led to me incorrectly assuming it was a different device (the SD card I have used and the USB are both the same size as the internal mmc).

However, when I try to format the drive from the GUI installer (with calamares/gparted/parted/fdisk) I get I/O errors.
Kde flavour: Https://termbin.com/r6eo
Gnome flavour: https://termbin/4346

I also can’t see the partitions on the disk, only the root device

I get the feeling I need to load the relevant dtb file from the SD image when booting the GUI but unsure how

short update:

I basically ran into two separate issues:

  • when booting the gui installer
    • I could see the internal eMMC, however I was unable to read it or perform any I/O operations. this prevented the installer/parted/gparted/fdisk from formatting the drive
    • noted that when booted into the gui installer iso, the internal mmc was labelled /dev/mmcblk0 which is what the postmarket wiki states it should be labelled as, however when I was booted extlinux it was labelled /dev/mmcblk2
  • when booted into the sd image through a usb/microSD:
    • I could see the internal mmc and perform the installation.
    • if I setup the disk with luks and mounted everything accordingly (I used disko) I could install into the partitions on the luks disk, with a fat32 partition mounted on /mnt/boot for exlinux to put its files
    • when I rebooted after the install I could see the derivations but attempting to boot them resulted in infinite black screen

gave up on this for now, i have a booting extlinux setup on the pinebook pro on the internal mmc, without luks. will return to try and make an efi+luks boot at some point when I have the nvme adapter for it.


once I am happy with my hyprland config on it I might try and get extlinux + luks working but might be easier to try and get efi booting properly