On a fresh Recore A8, sudo get-recore-serial-number prints nothing (exits 1) because
create-recore-config never creates the ext4 config image, so mount-config has nothing
to mount and set -e aborts before the cat.
Env: Recore A8, kernel 6.12.69-current-sunxi64, e2fsprogs 1.47.2.
Two bugs in create-recore-config
-
Formats a nonexistent partition node. It runs mkfs.ext4 /dev/${DEV}boot0p1, but
the kernel doesn't create child partition nodes for eMMC boot partitions —
/dev/mmcblk2boot0p1 never exists, so mkfs is skipped:
mke2fs ... The file /dev/mmcblk2boot0p1 does not exist and no size was specified.
mount-config doesn't use a partition node anyway — it loop-mounts the raw device at
offset=17408. The fs must be created at that offset, not on a ...p1 partition.
-
metadata_csum breaks reads. Once the fs is created at offset 17408, reads fail:
cat: serial_number: Bad message
EXT4-fs: ext4_dirblock_csum_verify: No space for directory leaf checksum
The fs is tiny → 1K block size, and metadata_csum (default-on in e2fsprogs 1.47)
leaves no room for the dir-leaf checksum at 1K blocks on this kernel.
Also: the create path writes via mount-config, which mounts read-only, so the
echo > serial_number would fail even with a valid fs.
Workaround (works)
echo 0 | sudo tee /sys/block/mmcblk2boot0/force_ro
LOOP=$(sudo losetup -f --show -o 17408 /dev/mmcblk2boot0)
sudo mkfs.ext4 -F -q -O ^metadata_csum,^64bit -E nodiscard "$LOOP"
sudo mount "$LOOP" /mnt/config
printf '0481\n' | sudo tee /mnt/config/serial_number
sudo wget -O /mnt/config/calibration.json \
https://raw.githubusercontent.com/intelligent-agent/Recore/master/Calibrations/Recore_A8_0481/calibration.json
sync; sudo umount /mnt/config; sudo losetup -d "$LOOP"
echo 1 | sudo tee /sys/block/mmcblk2boot0/force_ro
Suggested fix
Create the fs directly at offset 17408 via a loop device (drop fdisk/...boot0p1), pass
-O ^metadata_csum, and use a read-write mount in the create path.
On a fresh Recore A8,
sudo get-recore-serial-numberprints nothing (exits 1) becausecreate-recore-confignever creates the ext4 config image, somount-confighas nothingto mount and
set -eaborts before thecat.Env: Recore A8, kernel
6.12.69-current-sunxi64, e2fsprogs 1.47.2.Two bugs in
create-recore-configFormats a nonexistent partition node. It runs
mkfs.ext4 /dev/${DEV}boot0p1, butthe kernel doesn't create child partition nodes for eMMC boot partitions —
/dev/mmcblk2boot0p1never exists, so mkfs is skipped:mount-configdoesn't use a partition node anyway — it loop-mounts the raw device atoffset=17408. The fs must be created at that offset, not on a...p1partition.metadata_csumbreaks reads. Once the fs is created at offset 17408, reads fail:The fs is tiny → 1K block size, and
metadata_csum(default-on in e2fsprogs 1.47)leaves no room for the dir-leaf checksum at 1K blocks on this kernel.
Also: the create path writes via
mount-config, which mounts read-only, so theecho > serial_numberwould fail even with a valid fs.Workaround (works)
Suggested fix
Create the fs directly at offset 17408 via a loop device (drop fdisk/
...boot0p1), pass-O ^metadata_csum, and use a read-write mount in the create path.