[syslinux] [PATCH 4/5] utils/mkdiskimage.in: New option -S to sync zeroizing after each cylinder and to issue pacifier messages.
Thomas Schmitt
scdbackup at gmx.net
Thu Jul 10 12:21:25 PDT 2014
---
utils/mkdiskimage.in | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/utils/mkdiskimage.in b/utils/mkdiskimage.in
index 3948bee..9d4e887 100644
--- a/utils/mkdiskimage.in
+++ b/utils/mkdiskimage.in
@@ -139,6 +139,7 @@ if ( $file eq '' || $c < 1 || $h < 1 || $h > 256 || $s < 1 || $s > 63 ) {
print STDERR " -4 use partition entry 4 (standard for zipdisks)\n";
print STDERR " -i specify the MBR ID\n";
print STDERR " -s output a sparse file (don't allocate all blocks)\n";
+ print STDERR " -S sync after each zeroized cylinder and show count\n";
exit 1;
}
@@ -218,12 +219,24 @@ if ($opt{'s'}) {
} else {
$track = "\0" x (512*$s);
+ $show_pacifier = $opt{'S'};
+
# Print fractional track
print OUTPUT "\0" x (512 * ($s-1));
for ( $i = 1 ; $i < $tracks ; $i++ ) {
+ if ( $show_pacifier && ( $i - 1 ) % $h == 0 ) {
+ $cyl_to_write = ( $i - 1 ) / $h + 1;
+ IO::Handle::sync(OUTPUT);
+ print STDERR " zeroizing cylinder $cyl_to_write of $c\r";
+ }
print OUTPUT $track;
}
+ if ( $show_pacifier ) {
+ IO::Handle::sync(OUTPUT);
+ $zeroized = $totalsize + $zero_tail - 1;
+ print STDERR " $zeroized blocks zeroized. \n";
+ }
}
# Print mtools temp file
--
2.0.0
More information about the Syslinux
mailing list