BPI-R3: Bad hash value for 'hash@1' hash node in 'rootfs-1' image node

Working FDT set to 47ff8000
## Loading loadables from FIT Image at 46000000 ...
   Trying 'rootfs-1' loadables subimage
     Description:  ARM64 OpenWrt bananapi_bpi-r3 rootfs
     Type:         Filesystem Image
     Compression:  uncompressed
     Data Start:   0x4654c000
     Data Size:    31866880 Bytes = 30.4 MiB
     Hash algo:    crc32
     Hash value:   46d2185a
     Hash algo:    sha1
     Hash value:   68eac6db79f60f2deac5bd839782406a7eadc32d
   Verifying Hash Integrity ... crc32 error!
Bad hash value for 'hash@1' hash node in 'rootfs-1' image node
Bad Data Hash
Loadable(s) is corrupt or invalid
Press ENTER to return to menu

Got this if try to boot from sd-card image from firmware selector with custom package list or with ow build. What does it mean? What can i do to troubleshoot this?

I see one of two things happening:

  1. You selected too many packages to actually fit inside the rootfs. The maximum size is 104MB.
  2. The selector is bugged and isn't creating the image properly. It's supposed to build a new rootfs, insert it into the image, and update the device tree with the new partition's updated hashes.

I build my own images for the R3, so I don't know if the firmware selector builds are working right to begin with. How many extra packages did you add?

I can confirm the the issue, I git bisect to this commit https://github.com/openwrt/openwrt/commit/e7c399bee677e9bac66e1bea697aefb8d828edfe, I had to manually revert it because there are a lot of commits in between, I suspect some of the new functions introduced when they added a new device are the culprit.

1 Like

Thanx for your insight. I selected a lot of extra packages. Till kernel 5.15.102 it went all well. I'll try a build with less packages.

Thank you for making the effort to bisect, I believe I've tracked the issue down to a missing :

Please test and confirm that adding this : indeed fixes the issue.

I tested adding : but the problem still persist.

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index f1fa11b49a..b1b223c55b 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -47,7 +47,7 @@ define Device/asus_tuf-ax4200
   DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
   IMAGES := sysupgrade.bin
   KERNEL_LOADADDR := 0x48000000
-  KERNEL = kernel-bin | lzma | \
+  KERNEL := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
Working FDT set to 47ff8000
## Loading loadables from FIT Image at 46000000 ...
   Trying 'rootfs-1' loadables subimage
     Description:  ARM64 OpenWrt bananapi_bpi-r3 rootfs
     Type:         Filesystem Image
     Compression:  uncompressed
     Data Start:   0x46565000
     Data Size:    96931840 Bytes = 92.4 MiB
     Hash algo:    crc32
     Hash value:   3b6cd919
     Hash algo:    sha1
     Hash value:   7b8d14e5e81d75e43fcce043b0861b6ff8c0b330
   Verifying Hash Integrity ... crc32 error!
Bad hash value for 'hash@1' hash node in 'rootfs-1' image node
Bad Data Hash
Loadable(s) is corrupt or invalid
Press ENTER to return to menu

As the image is pretty large (> 100 MiB probably), did you:

  • switch off CONFIG_TARGET_ROOTFS_INITRAMFS
  • increase CONFIG_TARGET_ROOTFS_PARTSIZE which defaults to 104 MiB

I did increased CONFIG_TARGET_ROOTFS_PARTSIZE to 208 , I haven't had any issues before with that.

Working FDT set to 47ff8000

Loading loadables from FIT Image at 46000000 ...

Trying 'rootfs-1' loadables subimage
Description:  ARM64 OpenWrt bananapi_bpi-r3 rootfs
Type:         Filesystem Image
Compression:  uncompressed
Data Start:   0x4654c000
Data Size:    30220288 Bytes = 28.8 MiB
Hash algo:    crc32
Hash value:   126103b8
Hash algo:    sha1
Hash value:   bb024213b2c71e622b5ae20c7877255f6800f7fc
Verifying Hash Integrity ... crc32 error!
Bad hash value for 'hash@1' hash node in 'rootfs-1' image node
Bad Data Hash
Loadable(s) is corrupt or invalid

Still this result with a latest custom build.. Img size is 28.8MiB. Tried latest snapshot with custom pkg list from fw selector too. Same result.

Try adding # in line 49 target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index b1b223c55b..0efecca4c7 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -46,7 +46,7 @@ define Device/asus_tuf-ax4200
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
   IMAGES := sysupgrade.bin
-  KERNEL_LOADADDR := 0x48000000
+  # KERNEL_LOADADDR := 0x48000000
   KERNEL := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \

I was experiencing the same issue.
My custom builds had too many packages - I needed to scale back on what is included in the rootfs-1 partition.
Any rootfs-1 image larger than 20 MB won't boot, giving me the same Bad hash value for 'hash@1' hash node in 'rootfs-1' image node error.

The current build environment sets this partition to only 20 MB as seen in  openwrt/target/linux/mediatek/image/filogic.mk  (lines 30 - 33)

	$(if $(findstring sdmmc,$1), \
			-N install	-r	-p 20M@44M \
		-t 0x2e -N production		-p $(CONFIG_TARGET_ROOTFS_PARTSIZE)M@64M \
	) \
I may try to alter the partition sizes in this file and try to build an image with over 20 MB rootfs-1 size.

For now, I just tried to build an image with limited packages and the size of the rootfs-1 image was just over 8 MB.
It booted up for me:

Working FDT set to 47ff8000
## Loading loadables from FIT Image at 46000000 ...
   Trying 'rootfs-1' loadables subimage
     Description:  ARM64 OpenWrt bananapi_bpi-r3 rootfs
     Type:         Filesystem Image
     Compression:  uncompressed
     Data Start:   0x4652b000
     Data Size:    8634368 Bytes = 8.2 MiB
     Hash algo:    crc32
     Hash value:   6ca5a250
     Hash algo:    sha1
     Hash value:   aa10ddd1baccbc05c2c79b40cc5e16fd3ce87336
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Uncompressing Kernel Image
   Loading Device Tree to 00000000be7d2000, end 00000000be7dc74e ... OK
Working FDT set to be7d2000
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index b1b223c55b..0efecca4c7 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -46,7 +46,7 @@ define Device/asus_tuf-ax4200
   DEVICE_DTS_LOADADDR := 0x47000000
   DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
   IMAGES := sysupgrade.bin
-  KERNEL_LOADADDR := 0x48000000
+  # KERNEL_LOADADDR := 0x48000000
   KERNEL := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_INITRAMFS := kernel-bin | lzma | \

this worked for me..!

1 Like

The partition size should be set according to CONFIG_TARGET_ROOTFS_PARTSIZE.

Also partition size is not touched in the commit above, that makes it even more weird...

Edit: I get it now. Other than other platforms which need per-device override of KERNEL_LOADADDR we do not use KERNEL_LOADADDR := loadaddr-y in target/linux/mediatek/image/Makefile.
Hence the KERNEL_LOADADDR is not set to the default, and the changed default of the alphabetically preceding device (ASUS is before BananaPi) results in changed KERNEL_LOADADDR also for the BPi-R3. While this whole situation looks a bit messy, please try if this fixes it:

diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 2860f47242..cb25254ce8 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -66,6 +66,7 @@ define Device/bananapi_bpi-r3
   DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-gpio kmod-mt7986-firmware kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7986-wo-firmware
   IMAGES := sysupgrade.itb
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+  KERNEL_LOADADDR := 0x44000000
   ARTIFACTS := \
               emmc-preloader.bin emmc-bl31-uboot.fip \
               nor-preloader.bin nor-bl31-uboot.fip \

Sorry,

My bad image builds were somehow generating partition tables with both the 4079K partition at the start and the 20 MB install partition. I mistakenly thought that the rootfs was trying to be squeezed into the 20 MB install partition.

Your fix does the trick.

I really like this new BPI-R3 device.
Thanks for all of your hard work.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.