NixOS on ROC-RK3328-CC Renegade

I know this has already been asked multiple times by others, but I just can’t get it to boot.

(Sorry for the weird links. This forum only allows 2 links for new users)
I already tried

  • any and every method described in the official NixOS wiki
https://nixos.wiki/wiki/NixOS_on_ARM/Libre_Computer_ROC-RK3328-CC
  • the Hydra build method of this other topic post
https://hub.libre.computer/t/how-to-install-nixos-in-each-sbc/3753

I found on the Libre.Computer forum

  • I tried what this Reddit post suggested, though I did not write a package to replicate the official flashing tool

but they don’t seem to work.

I also read this topic post

https://hub.libre.computer/t/nixos-for-aml-s905x-cc-le-potato/3273

to try and figure something out, as well as this topic post

https://hub.libre.computer/t/le-potato-networking-unavilable-when-booting-in-uefi-mode/3825.

For full disclosure, this is my first SBC experience. I am not too familiar with u-boot, but I know that I have to flash the u-boot image after the OS image.

I also made a pretty detailed post over on the NixOS forum explaining my attempts before I stumbled upon the topics on the Libre.Computer forum. Then I tried basically everything I explained in the NixOS forum post again with 1. the downloaded Hydra build and 2. a self-compiled version of the Hydra build.

I have since then already realized that trying to boot from a USB stick does not work, but it doesn’t really matter since I tried everything on a SanDisk 128GB Ultra microSDXC

https://www.amazon.com/SanDisk-microSDXC-Speicherkarte-Smartphones-Lesegeschwindigkeit/dp/B0B7NTY2S6 

that should work with the board, as I previously got LibreELEC running on it (but only after using some patched version of u-boot specifically for this OS that I found on some Russian blog).

If anyone can help me figure this out, it would be much appreciated.

1 Like

The concept is simple. You have a normally UEFI booting arm64 Linux operating system partitioned with MBR flashed on one of the bootable media (usually eMMC/SD). GPT conflicts with our bootloader for the boards without onboard bootloader. Then you slap on our bootloader which passes the board device tree directly to the operating system. Done.

Ignore the overly complex instructions. This process applies for all of our boards. For UEFI boards (all designs after 2018), there’s no need to flash the bootloader since it’s built into the board. This allows those boards to support GPT disk images as well since the bootloader doesn’t conflict with the image partition table layout.

Thank you very much for your reply.

So as I understand it, the steps are:

  • Flash an arm64 Linux operating system onto my sd-card.
  • Look if the partition table is GPT or MBR.
    • If it is GPT, I have to build a bootloader as described here and flash it over the already flashed sd-card.
    • If it is MBR, I don’t have to do anything else.

Is that correct?

For more information: after flashing the sd-image-aarch64 onto my sd-card, the partition table looks like this:

1 Like

This is what I did to get NixOS running on the ROC-RK3328-CC Renegade:

  • NixOS ARM images are generic - they lack board-specific bootloaders
  • The ROC-RK3328-CC needs its specific U-Boot at exact disk locations:
  • idbloader.img at offset 32KB (sector 64)
  • u-boot.itb at offset 8MB (sector 16384)

1. Download NixOS unstable (latest packages, rolling release)

  https://hydra.nixos.org/job/nixos/trunk-combined/nixos.sd_image.aarch64-linux/latest/download/1/nixos-sd-image-aarch64-linux.img.zst

2. Get ROC-specific boot image from johang.se

curl -O https://dl.sd-card-images.johang.se/boots/2025-06-01/boot-roc_rk3328_cc.bin.gz

gunzip boot-roc_rk3328_cc.bin.gz

3. Extract U-Boot components from the boot image

dd if=boot-roc_rk3328_cc.bin of=idbloader.img bs=512 skip=64 count=8192
dd if=boot-roc_rk3328_cc.bin of=u-boot.itb bs=512 skip=16384 count=4096

4. Inject them into NixOS image

zstd -d nixos-sd-image-aarch64-linux.img.zst -o nixos-roc.img
dd if=idbloader.img of=nixos-roc.img conv=notrunc bs=512 seek=64
dd if=u-boot.itb of=nixos-roc.img conv=notrunc bs=512 seek=16384

5. Write to SD card (replace sdX with your device)

sudo dd if=nixos-roc.img of=/dev/sdX bs=4M status=progress conv=fsync

6. Boot the ROC, then SSH in and enable USB

  • First boot requires physical access - either keyboard/monitor or serial console
  • SSH won’t work until you set a password
    ssh nixos@<ROC-IP> # Find IP from router

A simpler way is just to get NixOS image and then use libretech-flash-tool ./lft.sh bl-flash to flash the bootloader onto the image or onto the device. This will grab our bootloader from boot.libre.computer.

I tried your flash tool. It did not work for me.

What exactly didn’t work?