How to do zroot on u-boot devices such as RK3399

Trying to find some information about this but it seems rather sparse, anyone got any pointers on how to this?
 
I have nothing valuable to offer but I thought you should qualify your question.
Specifically does your board offer an SPI ROM. The RockPi4B had SPI until version 1.72 where it was removed.
So this is really a weird part of the equation. You probably want to physically verify if unsure.

I think it helps to know because running U-Boot from SPI allows you to boot from it.
That means you can concentrate on ZFS devices and not worry about u-boot.
 
True, preferably I'd like to only rely on the microSD card as "unreliable" as it might be and not mess with SPI at all.
 
if u-boot has support for whatever you plan to be your root disk(s) then shouldn't be a problem
spi should not be any different than sd just a lot smaller but u-boot and loader should fit in in 16M without problems
 
I have wrongly stated in the past that you can just dd flash an SPI image to /dev/flash/spi0.
That was stupidly wrong.
u-boot BUBT does allow you to flash an SPI image from usb or sdcard.
 
you can write the spi from linux (and now freebsd) with a prebuilt u-boot image + efi part + loader
i may try on the orangepi3b and see if it works
also i think you can flash it from windows with some rockchip usb tool
 
spi should not be any different than sd just a lot smaller but u-boot and loader should fit in in 16M without problems
Right but you can't use the ports/packages version for u-boot on SPI.
You can generate the files with a ports build of u-boot for the platform.
The u-boot SPL files are the ones for SPI flash correct??? Serial Presence Loader???

I have been spoon fed the SPI files I flashed. espressoBin was my first.
 
i can just use dd
Code:
[root@generic ~]# dmesg|grep fspi
rk_fspi0: <Rockchip Flexible SPI Controller> mem 0xfe300000-0xfe303fff irq 65 on ofwbus0
rk_fspi0: Rockchip FSPI version 5
spibus0: <OFW SPI bus> on rk_fspi0
[root@generic ~]# gpart show flash/spi0
=>  34  8125  flash/spi0  GPT  (16M) [CORRUPT]
    34    30              - free -  (15K)
    64   960           1  linux-data  (480K)
  1024  6144           2  linux-data  (3.0M)
  7168   991              - free -  (496K)
 
Well diizzy sorry to interrupt your zroot thread.

I think you can see the value of having u-boot on its own small storage space. Even if microSD.

Would it be worth adding a SPI module to GPIO pins if no SPI present on board?
They are very cheap and an fdt overlay for SPI is pretty simple.



 
gpio is slow (< 100Khz) and spi is 100Mhz but most socs have spi controllers anyway and probably can expose the pins on the pinheader
so you can probably hook the module with some dupont wires
 
I am surprised that when ZFS (Auto) is used from the installer there is no options for single disk ZFS use.
Like a 'copies=2' option.
 
Back on topic diizzy

Tonight I took my first dive at FreeBSD Arm64 Personal Server. Rock4B with 256GB NVMe.

I want to build Arm64 images. So I am installing poudriere-devel so I can test poudriere-image on Arm64.

That would be my choice for handling ZFS images on Arm64.

embedded: u-boot ready embedded image



For poudriere image -t zrawdisk gives you a ZFS image like nanobsd.
I am going to build many of the various image types.
 
I'll have a look, I just want "release/distro" image using zroot instead of ufs basically... ;-)
 
After reviewing your needs I recommend Poudiere Image with -t of zfs+gpt which is the default type for a zfs build.
 
Quirks:
/etc/rc.conf only contained hostname. Hostname was derived from build name it appears.
/etc/fstab contained a label mount to root fs. Label was derived from build name too.

I would say you want to build with the -c option and provide your own config files via overlay.

I don't see any image type that seems to be for u-boot. Not sure how you are supposed to handle that.
Crochet has a nice mechanism for u-boot. I would hope Poudriere Image does as well.
 
I like that. How do I pull off ZFS "copies=2" on a manual install like this? Would I create two zfs partitions?

The installer doesn't seem to have provision for single disk install with copies=
That would be a good ZFS approach on single disks right?
For a 32GB eMMC losing half for a copy would be acceptable on embedded installs for me.
 
Studying the Oracle doc above:
These copies are in addition to any pool-level redundancy, such as in a mirrored or RAID-Z configuration
So I could do pool level redundancy with two mirrored partitions and/or copies=2 in a single pool.
 
I found the SOURCE information intriguing on the Oracle page above for zfs get copies
It shows 'local' as SOURCE. What does this pertain to? A network source possible for a copy?
Was this only Solaris or do we have that feature too?
 
Wow and 'set copies=2' does not apply to existing files.
Empty the whole pool to have it work retroactively?


Has this been solved with newer OpenZFS?
 
Back
Top