diff --git a/Makefile b/Makefile index e1b64d949..9d3e59cc7 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ dsk: asm index cp res/_FileInformation.txt build/ $(CADIUS) ADDFILE build/"$(DISK)" "/$(VOLUME)/" build/LAUNCHER.SYSTEM >>build/log cp res/PREFS.CONF build/PREFS.CONF - bin/padto.sh 512 build/PREFS.CONF >>build/log + bin/padto.sh build/PREFS.CONF # # create _FileInformation.txt files for subdirectories # @@ -105,7 +105,7 @@ dsk: asm index done bin/changebootloader.sh build/"$(DISK)" build/proboothd -index: md +index: md asmfx asmprelaunch # note: even though individual lines check individual files, you really want # to re-run this with a clean build/ directory if anything changes, because # everything is interconnected within TOTAL.DATA diff --git a/bin/padto.sh b/bin/padto.sh index 1721ab3d3..273ec6d55 100755 --- a/bin/padto.sh +++ b/bin/padto.sh @@ -1,11 +1,5 @@ #!/bin/bash -totalsize=$1 -outfile=$2 +# zero-pads $1 to a multiple of 512 bytes, in place -[[ "$OSTYPE" == "linux-gnu" ]] \ - && filesize=$(stat -c "%s" "$outfile") \ - || filesize=$(stat -f "%z" "$outfile") - -padsize=$((512-$filesize)) -dd if=/dev/zero bs=1 count=$padsize 2>/dev/null >> "$outfile" +dd if=/dev/null of="$1" bs=1 count=1 seek="$((($(wc -c < "$1") + 511) & -512))" 2>/dev/null