fix-pintos-script-geometry.patch (applied cleanly)
[pintos-anon] / src / utils / Pintos.pm
index 70df40d2309d234bd989667aa0f11647ba696969..9e722326d25a819aa1b705ef8fd53f5b3d37ce2f 100644 (file)
@@ -148,7 +148,9 @@ sub set_align {
 sub assemble_disk {
     my (%args) = @_;
 
-    my (%geometry) = $args{GEOMETRY} || (H => 16, S => 63);
+    my (%geometry) = %{$args{GEOMETRY}};
+    $geometry{H} = 16 if !defined $geometry{H};
+    $geometry{S} = 63 if !defined $geometry{S};
 
     my ($align);       # Align partition start, end to cylinder boundary?
     my ($pad);         # Pad end of disk out to cylinder boundary?
@@ -258,6 +260,7 @@ sub make_partition_table {
        $table .= pack ("V", $p->{SECTORS});          # Length in sectors
        die if length ($table) % 16;
     }
+    $table = "\0" x 16 . $table while length ($table) < 64;
     return pack ("a64", $table);
 }