ソースを参照

[build] Reinstate the .pdsk padded-floppy image format

Some utilities that expect a floppy disk image (e.g. iLO?) may test
for a file of the correct size.  Reinstate the .pdsk image format in
order to provide this if needed.
tags/v0.9.8
Michael Brown 15年前
コミット
7aee624881
2個のファイルの変更10行の追加3行の削除
  1. 6
    0
      src/arch/i386/Makefile.pcbios
  2. 4
    3
      src/util/padimg.pl

+ 6
- 0
src/arch/i386/Makefile.pcbios ファイルの表示

@@ -59,3 +59,9 @@ NON_AUTO_MEDIA	+= usb
59 59
 %usb: $(BIN)/usbdisk.bin %hd
60 60
 	$(QM)$(ECHO) "  [FINISH] $@"
61 61
 	$(Q)cat $^ > $@
62
+
63
+# Padded floppy image (e.g. for iLO)
64
+NON_AUTO_MEDIA += pdsk
65
+%pdsk : %dsk
66
+	$(Q)cp $< $@
67
+	$(Q)$(PADIMG) --blksize=1474560 $@

+ 4
- 3
src/util/padimg.pl ファイルの表示

@@ -23,8 +23,8 @@ GetOptions ( { map { /^(\w+)/; $1 => $opts->{$_} } keys %$opts }, keys %$opts )
23 23
 while ( my $filename = shift ) {
24 24
   die "$filename is not a file\n" unless -f $filename;
25 25
   my $oldsize = -s $filename;
26
-  my $newsize = ( ( $oldsize + $blksize - 1 ) & ~( $blksize - 1 ) );
27
-  my $padsize = ( $newsize - $oldsize );
26
+  my $padsize = ( ( -$oldsize ) % $blksize );
27
+  my $newsize = ( $oldsize + $padsize );
28 28
   next unless $padsize;
29 29
   if ( $verbosity >= 1 ) {
30 30
       printf "Padding %s from %d to %d bytes with %d x 0x%02x\n",
@@ -40,5 +40,6 @@ while ( my $filename = shift ) {
40 40
     truncate $filename, $newsize
41 41
 	or die "Could not resize $filename: $!\n";
42 42
   }
43
-  die "Failed to pad $filename\n" unless -s $filename == $newsize;
43
+  die "Failed to pad $filename\n"
44
+      unless ( ( ( -s $filename ) % $blksize ) == 0 );
44 45
 }

読み込み中…
キャンセル
保存