Mox: kernel fails to boot because of sparse blocks
U-boot in Turris Mox fails to correctly reads sparse blocks from BTRFS. Boot fails if kernel is saved to FS with such content.
Common output on serial console:
U-Boot 2018.11 (Dec 16 2018 - 12:50:19 +0000), Build: jenkins-turris-os-packages-kittens-mox-90
DRAM: 512 MiB
Enabling Armada 3720 wComphy-0: SGMII1 3.125 Gbps
Comphy-1: PEX0 5 Gbps
Comphy-2: USB3_HOST0 5 Gbps
MMC: sdhci@d8000: 0
Loading Environment from SPI Flash... SF: Detected w25q64dw with page size 256 Bytes, erase size 4 KiB, total 8 MiB
OK
Model: CZ.NIC Turris Mox Board
Net: eth0: neta@30000
Turris Mox:
Board version: 22
RAM size: 512 MiB
Serial Number: 000000000000000
ECDSA Public Key: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
SD/eMMC version: SD
Module Topology:
1: Passthrough Mini-PCIe Module
2: USB 3.0 Module (4 ports)
3: Topaz Switch Module (4-port)
Hit any key to stop autoboot: 0
gpio: pin GPIO221 (gpio 57) value is 0
gpio: pin GPIO220 (gpio 56) value is 1
SF: Detected w25q64dw with page size 256 Bytes, erase size 4 KiB, total 8 MiB
device 0 offset 0x7f0000, size 0x10000
SF: 65536 bytes @ 0x7f0000 Read: OK
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
963 bytes read in 90 ms (9.8 KiB/s)
## Executing script at 04d00000
19412 bytes read in 61 ms (310.5 KiB/s)
btrfs_map_logical_to_physical: Cannot map logical address 0 to physical
btrfs_file_read: Error reading extent
An error occured while reading file /@/boot/Image
0 bytes read in 384 ms (0 Bytes/s)
## Flattened Device Tree blob at 04f00000
Booting using the fdt blob at 0x4f00000
Loading Device Tree to 000000001bf14000, end 000000001bf1bbd3 ... OK
Starting kernel ...
"Synchronous Abort" handler, esr 0x02000000
elr: ffffffffe5a4d000 lr : 00000000000026c4 (reloc)
elr: 0000000005980000 lr : 000000001ff356c4
x0 : 000000001bf14000 x1 : 0000000000000000
x2 : 0000000000000000 x3 : 0000000000000000
x4 : 0000000005080000 x5 : 0000000000000001
x6 : 0000000000000008 x7 : 0000000000000000
x8 : 000000001c100000 x9 : 0000000000000002
x10: 000000000a200023 x11: 0000000000000002
x12: 0000000000000002 x13: 00000000ffffffff
x14: 0000000000000000 x15: 000000001ff34b34
x16: 0000000000000002 x17: 000000001bf1bbd4
x18: 000000001bf22de8 x19: 000000001ffd39d0
x20: 0000000000000000 x21: 0000000000000000
x22: 0000000000000003 x23: 000000001bfd3238
x24: 000000001ffc1b00 x25: 0000000000000000
x26: 000000001ff356ec x27: 0000000000000400
x28: 000000001bfd3260 x29: 000000001bf1d890
Resetting CPU ...
resetting ...