Jose Luis Posted December 12, 2025 Posted December 12, 2025 Hi, I've a rock-3a board with an NVMe device and a BTRFS filesystem using the whole disk ( no partitions ) I've seen some devices having BTRFS support in u-boot, so first thing I built the u-boot images using the extension: cat extensions/uboot-btrfs.sh # Enable BTRFS support in u-boot function post_config_uboot_target__enable_uboot_btrfs_support() { display_alert "u-boot for ${BOARD}/${BRANCH}" "u-boot: enable BTRFS filesystem support" "info" run_host_command_logged scripts/config --enable CONFIG_CMD_BTRFS } And patched the configuration of the board: git diff . diff --git a/config/boards/rock-3a.conf b/config/boards/rock-3a.conf index 401894fa5..90f8a8a72 100644 --- a/config/boards/rock-3a.conf +++ b/config/boards/rock-3a.conf @@ -15,12 +15,15 @@ BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" BOOTFS_TYPE="fat" +# Enable btrfs support in u-boot +enable_extension "uboot-btrfs" + function post_family_config__rock-3a_use_mainline_uboot_except_vendor_and_add_sata_target() { display_alert "$BOARD" "Configuring ($BOARD) standard and sata uboot target map" "info" UBOOT_TARGET_MAP=" ./compile.sh artifact BOARD=rock-3a BRANCH=current RELEASE=trixie BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,img ROOTFS_TYPE=btrfs FIXED_IMAGE_SIZE=4096 DISABLE_IPV6=false WHAT=uboot With this I flashed the SPI image: root@rock-3a:~# flashcp u-boot-rockchip-spi.bin /dev/mtd0 root@rock-3a:~# cat /proc/mtd dev: size erasesize name mtd0: 01000000 00001000 "spi4.0" So, then I booted it without the SD card I use for the /boot partition, used the serial port ( as it didn't autoboot ) and I saw: => nvme info Device 0: Vendor: 0x2646 Rev: SBM02103 Prod: 50026B778514A843 e: Hard Disk Capacity: 953869.7 MB = 931.5 GB (1953525168 x 512) => btrsubvol nvme 0:1 ** No partition table - nvme 0 ** Couldn't find partition nvme 0:1 => btrsubvol nvme 0:0 ID 257 gen 153600 path /@rootfs/ ID 257 gen 153600 path /@rootfs/ ID 259 gen 153599 path /@home/ => ls nvme 0:0 /boot/ <DIR> 16 Sat Dec 06 08:32:08 2025 dtb < > 0 Sat Dec 06 08:44:38 2025 .next < > 37679616 Sat Nov 15 03:03:00 2025 Image < > 5560276 Tue Nov 11 22:48:14 202urrent-rockchip64 < > 5560445 Sat Nov 15 03:03:00 2025 System.map-6.12.58-current-rockchip64 < > 236 Sat Dec 06 08:54:54 2025 armbianEnv.txt< > 200 Sat Sep 09 08:armbianEnv.txt.old < > 0 Tue Jun 18 18:05:14 2024 armbianEnv.txt.out < > 1536 Thu Aug 31 17:25:06 2023 armbian_first_run.txt.template < > 38518 Thu Aug 31 17:25:04 2023 boot.bmp < > 3180 Thu Aug 31 17:20:00 2023 boot.cmd < > 3252 Thu Aug 31 17:26:44 20 boot.scr < > 258746 Tue Nov 11 22:48:14 2025 config-6.12.57-current-rockchip64 < > 258803 Sat Nov 15 03:03:00 2025 config-6.12.58-current-ro< > 29107600 Tue Nov 25 21:2 2025 initrd.img-6.12.57-current-rockchip64 < > 29108356 Sat Dec 06 08:44:34 2025 initrd.img-6.12.58-current-rockchip64< > 29108420 Sat Dec 06 08: So it can read BTRFS, but no booting, I tried manually based on some commands I get but no luck: => load nvme 0:0 $loadaddr /boot/boot.scr 3252 bytes read in 27 ms (117.2 KiB/s) => source ## Executing script at 00c00800 Boot script loaded from ** Bad device specification 0x9000000 armbianEnv ** ** Bad device specification 0x9000000 armbianEnv.txt ** Couldn't find partit Can't set block device ** Bad device specification 0x12180000 uInitrd ** ** Bad device specification 0x12180000 uInitrd ** Couldn't find partition 0x1218000ck device ** Bad device specification 0x02000000 Image ** ** Bad device specification 0x020000on 0x02000000 Image Can't set block device ** Bad device specification 0x12000000 dtb/rockchipspecification 0x12000000 dtb/rockchip/rk3568-rock-3a.dtb ** Couldn't find partition 0x12000000 t set block device libfdt fdt_check_header(): FDT_ERR_BADMAGIC No FDT memory address configure via "fdt addr <address>" command. Aborting! ** Bad device specification 0x9000000 dtb/rockchiay/-fixup ** ** Bad device specification 0x9000000 dtb/rockchip/overlay/-fixup.scr ** Couldn'tp/overlay/-fixup.scr Can't set block device ** Bad device specification 0x9000000 fixup ** **0 fixup.scr ** Couldn't find partition 0x9000000 fixup.scr Can't set block device Applying us ## Executing script at 09000000 Wrong image format for "source" command Unknown command 'kaslRM64 Image magic! I'd like to get this worked, I can test anything you can provide me, I'm a n00b trying to learn a bit more about U-Boot. Thanks in advance. 0 Quote
eselarm Posted December 12, 2025 Posted December 12, 2025 (edited) Your serial console cable seems to drop several characters or so, but that should not matter for booting. What matters I think is that you have no partition and I see in boot.cmd test -n "${distro_bootpart}" || distro_bootpart=1 echo "Boot script loaded from ${devtype} ${devnum}:${distro_bootpart}" This 1 year old, yours might be different. So if your boot.scr is still compiled from such boot.cmd content (see end of file how), I think it won't work. I have used parttitionless Btrfs, but not for OS rootfs, I also think GRUB will need a hack then. So if possible make it with just as default as possible, a 1st partition btrfs formatted with rootfs and likely also the rootfs subvol set as default. Also that is a tricky thing with GRUB (Debian) I know. I wiped a bootFAT partition actually, so about 16M+256M space before rootfs partition and also sorted the GPT table to default, so 1st entry Btrfs rootfs. I find the boot cmd rather complex, I used a minimum direct one as well for tests. see My (ROCK3A 24/7 up now) has bootFAT again, I did wipe/hide boot.* and armbianEnv.txt and use extlinux, so I can select a specific kernel option via serial console. /extlinux/extlinux.conf menu title Select the kernel variant DEFAULT vendor TIMEOUT 80 LABEL vendor KERNEL 6.1.115-vendor-rk35xx/Image INITRD 6.1.115-vendor-rk35xx/uInitrd FDT 6.1.115-vendor-rk35xx/rk3568-rock-3a.dtb FDTOVERLAYS 6.1.115-vendor-rk35xx/rock-3a-sata.dtbo APPEND root=LABEL=armbidroot rootwait rw earlyprintk console=ttyS2,1500000 cma=256M LABEL edge KERNEL 6.17.0-edge-rockchip64/Image INITRD 6.17.0-edge-rockchip64/uInitrd FDT 6.17.0-edge-rockchip64/rk3568-rock-3a.dtb APPEND root=LABEL=armbidroot rootwait rw earlyprintk console=ttyS2,1500000 cma=256M As this is on extra FAT, I need extra copies for all the files referenced, but when only 1 Btrfs, it should be possible to refer to files in /boot and elsewhere. Edited December 12, 2025 by eselarm 0 Quote
Jose Luis Posted December 13, 2025 Author Posted December 13, 2025 Hi @eselarm, thanks for the detailed response. I've checked my boot.cmd and boot.scr is ancient ( from Aug 2023 ). I'm going to try to set the variables beforehand, as I see in the output they are blank ( devtype, devnum, prefix ). When I succeed I guess the next step will be to set these variables in U-Boot, but nowadays there's no gpt partition table in SPI with the uboot_env, so I guess will need to figure it out later ( via env or find the boot.scr in the NVMe ), first I want to try to boot from NVMe manually. Thanks again 0 Quote
Solution Jose Luis Posted December 19, 2025 Author Solution Posted December 19, 2025 (edited) Ok, I got it booting, so I did: set devtype nvme set devnum 0 set distro_bootpart 0 set prefix /boot/ load nvme 0:0 $loadaddr /boot/boot.scr source Doing a printenv before I see: => printenv arch=arm baudrate=1500000 board=evb_rk3568 board_name=evb_r_targets=mmc1 mmc0 nvme scsi usb pxe dhcp spi bootcmd=bootflow scan -lb bootdelay=1 bootp_arcNDI:003000 cpu=armv8 cpuid#=54434e4b383000000000000000070d19 dnsip=192.168.1.253 eth1addr=1e000 ethaddr=1e:f2:d5:f1:74:04 fdt_addr_r=0x12000000 fdtcontroladdr=7ded3a80 fdtfile=rockchipr=0x12100000 gatewayip=192.168.1.254 hostname=rock-3a ipaddr=192.168.1.253 kernel_addr_r=0x00 kernel_comp_size=0x8000000 loadaddr=0xc00800 netmask=255.255.255.0 pxefile_addr_r=0x00e000offset_f=0xffe000 script_size_f=0x2000 scriptaddr=0x00c00000 serial#=09103e09ce4edd27 serverserial@fe660000 stdin=serial@fe660000 stdout=serial@fe660000 vendor=rockchip Environment size: 916/126972 bytes So this is not finding the boot.scr with the bootflow scan -lb, so now is time to make it boot automatically. Edited December 19, 2025 by Jose Luis 0 Quote
eselarm Posted December 19, 2025 Posted December 19, 2025 (edited) 4 hours ago, Jose Luis said: board=evb_rk3568 I am not sure if this will lead to problems. The SBC is a Radxa ROCK3A. It might be EVB was used for development and never changed. Maybe won't matter as later on kernel rock-3a dtb is loaded. But could be a reason for issues I saw (year ago) with mainline u-boot, therefor I use Radxa's one / legacy. Edited December 19, 2025 by eselarm 0 Quote
Jose Luis Posted December 21, 2025 Author Posted December 21, 2025 Well, I finally used some disk drives to move the btrfs data live, repartition with GPT using a vFAT and btrfs partition with 16MB offset of u-boot before the first partition, so with this boots automatically, and I guess more mainline. Thanks @eselarm for your comments, I'll these variables later. 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.