Last year, I got NixOS to boot from an SD card on my Asus chromebook. It was full-disk encrypted using LUKS, filesystem was ZFS (but not using ZFS native encryption.) The boot & header weren’t encrypted, and were installed on a separate usb stick. I’m attempting to do something similar on a new asus chromebook, however I’m running into a weird issue where it hangs on boot. This new setup should be simpler (no detached header, boot is on the same SD as the filesystem.) Here’s some information:
Hardware: Asus Chromebook, 64 bit, Intel celeron CPU N3350. BIOS is coreboot but dmidecode -t bios
lists no version. Claims PCI is supported, PC Card (PCMCIA) is supported, BIOS is upgradeable, ACPI is supported, BIOS revision is 4.0, Firmware revision is 0.0, SMBIOS 2.7 is present.
I’ve done the typical thing one does when they intend to install linux on their chromebook: enabled legacy boot, installed the mrchromebox firemware (the RW_LEGACY boot version, not the one that requires physical access to the eMMC memory,) and have successfully booted from USB using my NixOS installation media.
The target for the installation is an SD card inserted into the chromebook. I unfortunately don’t have my old instructions from a year ago, so I’m doing this from memory.
When I boot from the new installation, it gets to the grub menu where I can select which nixos configuration to boot, but once I hit enter, it displays the “NixOS” screen and doesn’t even let me open the disk. Grub doesn’t report any error messages. Journalctl doesn’t log any journal entries after boot attempts (because the disk never even gets decrypted.)
Here are the installation steps I’ve taken for this chromebook:
parted /dev/mmcblk1 -- mklabel msdos
parted /dev/mmcblk1 -- mkpart primary fat32 0% 2%
parted /dev/mmcblk1 -- mkpart primary 2% 100%
mkfs.vfat -F32 /dev/mmcblk1
cryptsetup luksFormat /dev/mmcblk1p2
cryptsetup luksOpen /dev/mmcblk1p2 enc-pv
pvcreate /dev/mapper/enc-pv
vgcreate vg /dev/mapper/enc-pv
lvcreate -L 2G -n swap vg
lvcreate -l '100%FREE' -n root vg
mkswap -L swap /dev/vg/swap
zpool create -f -O atime=off -O xattr=sa -O mountpoint=none "rpool" /dev/vg/root
zfs create -p -o compression=on -o mountpoint=legacy "rpool/local/root"
zfs create -o compression=on -o mountpoint=legacy "rpool/local/nix"
zfs create -o compression=on -o mountpoint=legacy "rpool/safe"
zfs create -o compression=on -o mountpoint=legacy "rpool/safe/home"
zfs create -o compression=on -o mountpoint=legacy "rpool/safe/persist"
mount -t zfs "rpool/local/root" /mnt
mkdir /mnt/nix
mount -t zfs "rpool/local/nix" /mnt/nix
mkdir /mnt/home
mount -t zfs "rpool/safe/home" /mnt/home
mkdir /mnt/persist
mount -t zfs "rpool/safe/persist" /mnt/persist
mkdir -p /mnt/boot
mount /dev/mmcblk1p1 /mnt/boot
nixos-generate-config --root /mnt
wpa_supplicant -B -i wlp1s0 -c <(wpa_passphrase '[network name]' '[network password]') &
nano /mnt/etc/nixos/configuration.nix
nixos-install --root /mnt
The configuration file is edited to include the location of the LUKS container, and the hostId is set (for ZFS.)
Some settings in configuration.nix
which could be relevant:
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/mmcblk1";
boot.loader.grub.enableCryptodisk = true;
boot.loader.grub.zfsSupport = true;
boot.loader.grub.version = 2;
boot.initrd.luks.devices.luksroot = {
device="/dev/disk/by-uuid/<redacted>";
preLVM =true;
allowDiscards =true;
};
networking.hostId = "<redacted>";
services.xserver ={
enable = true;
displayManager.lightdm.enable = true;
desktopManager.xfce.enable = true;
};
Pretty sure enableCryptodisk
and zfsSupport
are unnecessary. I’ve attempted booting with them enabled and with them disabled, and it makes no difference. I’ve also attempted re-installing with a gpt partition scheme and systemd, and that also made no difference. I’ve also toggled efiSupport and efiInstallAsRemovable on and off, and it made no difference.
I also tried booting a default config, like a basic nixos install with no luks, no zfs, just a basic ext4, and no change. It hangs on boot before even reaching stage 1.
I’m puzzled. Any ideas?