Create barebox env - crc

How can I create/edit barebox env partition? I tried upload MiniOS to sda1 and edit [boot-md0.env]: change root=/dev/sda1 and upload to sda7 (all from https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen1/Developing/) but I still get error after boot:
“sataenv: partition 7 wrong crc on env data”
and bootargs is without root=/dev/sda1.
How can I create/modify barebox.env partition with correct crc?

Thanks

Log from boot:
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
sataenv: partition 7 wrong crc on env data
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
sataenv: partition 8 wrong crc on env data
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 512 byte transferred.
ahci_exec_ata_cmd: 10485760 byte transferred.
Success: 20480 sectors read into address 03008000 from sector 0x17439800
Verifying Checksum … OK
Image Name: Linux-3.2.68
Created: 2015-11-28 13:38:49 UTC
Image Type: ()
Data Size: 3390344 Bytes = 3.2 MB
Load Address: 0f008000
Entry Point: 0f008000
OK

Starting kernel ...

commandline: console=ttyS0,115200n8, init=/sbin/init rootfstype=ext4 rw noinitrd mac_addr=00:10
arch_number: 1094
Uncompressing Linux... done, booting the kernel.

It looks like no one replied to your question, and it has been over a year. Belated welcome to the forums though!

I’m searching for the same info. In the GPL Source Code tarball that WD provide on the support downloads page, you will find a folder called barebox-2011.06.0. Under that folder is the entire source code (presumably) used by WD for the bootloader on Gen1 devices

A quick text search reveals the string wrong crc on env data appearing in only one file
barebox-2011.06.0/commands/sataenv.c

It ought to be possible to determine how barebox is deciding that the CRC is wrong and thus feed it something it will think is right. I suspect the first non-printing bytes when you cat /dev/sda7 (or /usr/local/share/k1m0.env from WD Factory Firmware sq-<some_version.deb may have something to do with it.

I’ll post more when I discover more.

1 Like

I developed the following guide