From: Michael Brown Date: Wed, 23 Aug 2006 03:07:41 +0000 (+0000) Subject: Quick utility to pad floppy disk images for vmware/qemu X-Git-Tag: v0.9.3~1077 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cddf8df8d4522f2fbc42520e9bfde9325caf0f56;p=thirdparty%2Fipxe.git Quick utility to pad floppy disk images for vmware/qemu --- diff --git a/src/util/dskpad.pl b/src/util/dskpad.pl new file mode 100755 index 000000000..3ae325eb4 --- /dev/null +++ b/src/util/dskpad.pl @@ -0,0 +1,12 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; + +use constant FLOPPYSIZE => 1440 * 1024; + +while ( my $filename = shift ) { + die "$filename is not a file\n" unless -f $filename; + die "$filename is too large\n" unless ( -s $filename <= FLOPPYSIZE ); + truncate $filename, FLOPPYSIZE or die "Could not truncate: $!\n"; +}