From 3ace5f4ec3e17f05eea53cb493da72c9df54bf16 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 2 Mar 2007 16:27:35 -0800 Subject: [PATCH] mkdiskimage: shortcut for zipdisk geometry --- mkdiskimage.in | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mkdiskimage.in b/mkdiskimage.in index 3db9bbe..856ad3c 100755 --- a/mkdiskimage.in +++ b/mkdiskimage.in @@ -1,7 +1,7 @@ #!/usr/bin/perl ## ----------------------------------------------------------------------- ## -## Copyright 2002-2004 H. Peter Anvin - All Rights Reserved +## Copyright 2002-2007 H. Peter Anvin - All Rights Reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -68,7 +68,12 @@ $pentry = 2 if ( $opt{'2'} ); $pentry = 3 if ( $opt{'3'} ); $pentry = 4 if ( $opt{'4'} ); -if ( $opt{'M'} ) { +if ( $opt{'z'} ) { + $h = $h || 64; + $s = $s || 32; +} + +if ( $opt{'M'} && $h && $s ) { # Specify size in megabytes, not in cylinders $c = ($c*1024*2)/($h*$s); } @@ -100,11 +105,12 @@ if ( $c == 0 && $file ne '' ) { if ( $file eq '' || $c < 1 || $c > 1024 || $h < 1 || $h > 256 || $s < 1 || $s > 63 ) { - print STDERR "Usage: $0 [-doF4] file [c h s] (max: 1024 256 63)\n"; + print STDERR "Usage: $0 [-doFMz4] file c h s (max: 1024 256 63)\n"; print STDERR " -d add DOSEMU header\n"; print STDERR " -o print filesystem offset to stdout\n"; print STDERR " -F format partition as FAT32\n"; print STDERR " -M \"c\" argument is megabytes, calculate cylinders\n"; + print STDERR " -z use zipdisk geometry (h=64 s=32)\n"; print STDERR " -4 use partition entry 4 (standard for zipdisks)\n"; exit 1; } -- 2.7.4