sd-image: Verifies the FAT partition before copying it.

This is to ensure `mtools`-based operations don't wreck the FS.
This commit is contained in:
Samuel Dionne-Riel 2018-11-27 21:51:41 -05:00 committed by Tuomas Tynkkynen
parent 2570da8077
commit 2e5eb135aa

View File

@ -135,6 +135,8 @@ in
# Copy the populated /boot into the SD image # Copy the populated /boot into the SD image
(cd boot; mcopy -bpsvm -i ../bootpart.img ./* ::) (cd boot; mcopy -bpsvm -i ../bootpart.img ./* ::)
# Verify the FAT partition before copying it.
fsck.vfat -vn bootpart.img
dd conv=notrunc if=bootpart.img of=$img seek=$START count=$SECTORS dd conv=notrunc if=bootpart.img of=$img seek=$START count=$SECTORS
''; '';
}) {}; }) {};