mirror of
https://github.com/ipxe/ipxe.git
synced 2026-04-30 01:52:07 +02: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:
parent
a0bf3f1cc8
commit
0d30ee7b49
@ -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}"/* ::
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user