mirror of
https://github.com/ipxe/ipxe
synced 2026-05-10 18:10:36 +03:00
[build] Ensure that generated filesystem images retain no stale content
We use mformat to ensure that the FAT filesystem starts as empty. However, formatting the filesystem can still leave old data blocks present (though unreferenced) within the disk image. Truncate the image to a zero length before extending, to ensure that no stale content is retained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
+2
-1
@@ -312,7 +312,6 @@ fi
|
||||
if [ -n "${FATIMG}" ] ; then
|
||||
FATSIZE=$(du -s -k "${FATDIR}" | cut -f1)
|
||||
FATSIZE=$(( FATSIZE + PAD + 256 ))
|
||||
touch "${FATIMG}"
|
||||
if [ "${FATSIZE}" -le "1440" ] ; then
|
||||
FATSIZE=1440
|
||||
FATARGS="-f 1440"
|
||||
@@ -325,6 +324,8 @@ if [ -n "${FATIMG}" ] ; then
|
||||
FATSERIAL=$(( SOURCE_DATE_EPOCH % 100000000 ))
|
||||
FATARGS="${FATARGS} -N ${FATSERIAL}"
|
||||
fi
|
||||
touch "${FATIMG}"
|
||||
truncate -s 0 "${FATIMG}"
|
||||
truncate -s "${FATSIZE}K" "${FATIMG}"
|
||||
mformat -v iPXE -i "${FATIMG}" ${FATARGS} ::
|
||||
mcopy -i "${FATIMG}" -s "${FATDIR}"/* ::
|
||||
|
||||
Reference in New Issue
Block a user