altmbr: cap at 439 bytes so the partition select byte follows
authorH. Peter Anvin <hpa@zytor.com>
Tue, 26 May 2009 02:13:04 +0000 (19:13 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 26 May 2009 02:16:24 +0000 (19:16 -0700)
Cap altmbr at 439 bytes, so that the partition select byte is not part
of the file.  This means that:

a) updating the altmbr doesn't clobber the configuration;
b) it is easier to simply concatenate the select byte to the file.

This also matches gptmbr behavior.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
NEWS
mbr/checksize.pl

diff --git a/NEWS b/NEWS
index b032a41..bfc65e3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,8 @@ Changes in 3.81:
        * Menu system: don't set the autocr flag on the serial
          console.
        * altmbr: fix handling of logical partitions.
+       * altmbr: cap at 439 bytes so the partition select byte isn't
+         part of the file.
 
 Changes in 3.80:
        * New shuffler mechanism and API.
index 7d61bdf..c1984db 100755 (executable)
@@ -30,7 +30,7 @@ if (!defined($maxsize)) {
     } elsif ($file =~ /^isohdp[fp]x[^0-9a-z]/) {
        $maxsize = $padsize = 432;
     } elsif ($file =~ /^altmbr[^0-9a-z]/) {
-       $maxsize = 439; $padsize = 440;
+       $maxsize = $padsize = 439;
     } else {
        die "$0: no default size for filename: $file\n";
     }