Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hd-image: add support for specifying byte value used for filling
Today I was fooled by the combination of (1) util.c being quite clever/aggressive with respect to creating sparse images and avoiding writing zeroes explicitly and (2) using bmaptool to populate an SD card, thus being aware of unwritten regions of the image. Specifically, I had a U-Boot environment partition where I now set "fill = true", so that any trace of the previous environment should be gone, and U-Boot on first boot should just use its default/static environment. But that was not what I observed: After writing the sd card, the U-Boot partition still has its old content, meaning that the new U-Boot ended up using a completely wrong environment. In order to be sure that such a partition is definitely overwritten, allow specifiyng the byte value used for filling. Any non-zero value should work fine. Alternatively/additionally, we could consider relaxing the sparseness, so that, say, the first 4096 bytes of the padding are always explicitly written. But I don't know if bmaptool is so "smart" that it checks whether it has a full 4096 bytes of zeroes and then turning that into a sparse write anyway. Signed-off-by: Rasmus Villemoes <[email protected]>
- Loading branch information