Add padding tool for DriveWire images
authorTormod Volden <debian.tormod@gmail.com>
Mon, 6 Apr 2015 10:38:08 +0000 (12:38 +0200)
committerAlan Cox <alan@linux.intel.com>
Mon, 6 Apr 2015 12:15:18 +0000 (13:15 +0100)
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/platform-dragon-nx32/Makefile
Kernel/tools/pad256 [new file with mode: 0755]

index 422c63b..5dfc5cc 100644 (file)
@@ -33,3 +33,4 @@ image:
        ../syscall_proc.o ../syscall_other.o ../mm.o \
        ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \
        devlpr.o devtty.o libc.o ../vt.o
+       ../tools/pad256 ../fuzix.bin
diff --git a/Kernel/tools/pad256 b/Kernel/tools/pad256
new file mode 100755 (executable)
index 0000000..6b2fed0
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash -e
+
+# adds zero padding to a file to get size multiple of 256
+
+size=$(stat --format=%s $1)
+newsize=$(( (size+255)/256*256 ))
+dd if=/dev/zero of=$1 conv=notrunc oflag=append bs=1 count=$((newsize-size)) status=noxfer