On Tue, Feb 18, 2020 at 11:05 AM Peter Maydell <address@hidden
On Tue, 18 Feb 2020 at 06:46, Philippe Mathieu-Daudé <address@hidden> wrote:
> IIRC from the specs, cards are block devices and the only alignment
> required is the size of a block (512KiB for your 4GiB card).
Isn't there something related to erase blocks too, which impose
a larger granularity than just a single block?
Anyway, in general the backing image for an SD card device
needs to be exactly the size of the SD card you're emulating,
because QEMU needs somewhere it can write back the data
if the guest decides to write to the last block on the card.
So short-length images generally don't work (true for all
block devices, not just SD cards, I think). This often bites users
if they're using some distro "here's a disk/sd card image file"
where the expected use with real hardware is "dd the image
file onto the SD card".
Yes, the description you gave here is indeed the issue.
And unfortunately in this particular case, the distro did not give a very understandable
diagnostic error message.