aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2002-10-24 04:05:47 +0000
committerhpa <hpa>2002-10-24 04:05:47 +0000
commitde9e52085ecde8375bbc1e4859f086ec2bb28f5c (patch)
treeb349d61afc96a7322239a078219901519ef78d85
parentea2c13ab4e1760cc2e5b5737016eb6d308bfe29e (diff)
downloadsyslinux-de9e52085ecde8375bbc1e4859f086ec2bb28f5c.tar.gz
syslinux-de9e52085ecde8375bbc1e4859f086ec2bb28f5c.tar.xz
syslinux-de9e52085ecde8375bbc1e4859f086ec2bb28f5c.zip
Add option to display the generated filesystem offsetsyslinux-2.00-pre11
-rwxr-xr-xmkdiskimage.in21
1 files changed, 19 insertions, 2 deletions
diff --git a/mkdiskimage.in b/mkdiskimage.in
index d0d8703c..009a0430 100755
--- a/mkdiskimage.in
+++ b/mkdiskimage.in
@@ -5,12 +5,24 @@
use Fcntl;
-($file,$c,$h,$s) = @ARGV;
+%opt = ();
+@args = ();
+
+for $a ( @ARGV ) {
+ if ( $a =~ /^\-/ ) {
+ $opt{$'} = 1;
+ } else {
+ push(@args, $a);
+ }
+}
+
+($file,$c,$h,$s) = @args;
$c += 0; $h += 0; $s += 0;
if ( !$file || $c < 1 || $c > 1024 ||
$h < 1 || $h > 256 || $s < 1 || $s > 63 ) {
- print STDERR "Usage: $0 file c h s (max: 1024 256 63)\n";
+ print STDERR "Usage: $0 [-o] file c h s (max: 1024 256 63)\n";
+ print STDERR " -o print filesystem offset to stdout\n";
exit 1;
}
@@ -78,6 +90,11 @@ print MCONFIG "sectors=${s}\n";
print MCONFIG "offset=${offset}\n";
close(MCONFIG);
+# Output the filesystem offset to stdout if appropriate
+if ( $opt{'o'} ) {
+ print $offset, "\n";
+}
+
$ENV{'MTOOLSRC'} = $tmpfile;
system('mformat', 'z:');