summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-07 19:23:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-09-07 19:23:31 -0700
commit99bc863824b1a2ea13931ac0ebfb6eba50118d0a (patch)
tree8e18c47005372ada2e15d500cf1096899ecba224 /utils
parent9fac1a7afcbf94dcd3092b5bb519a3c2dd7032ea (diff)
downloadsyslinux-99bc863824b1a2ea13931ac0ebfb6eba50118d0a.tar.gz
isohybrid: verify we have a hybrid-compatible isolinux.bin
Verify that the PXE boot loader is a hybrid-compatible isolinux.bin by looking for the hybrid boot signature, otherwise print an error message. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/isohybrid.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index 1dcdf10e..25c79276 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -76,6 +76,14 @@ if ($de_boot != 0x88 || $de_media != 0 ||
die "$0: $file: unexpected boot catalog parameters\n";
}
+# Now $de_lba should contain the CD sector number for isolinux.bin
+seek(FILE, $de_lba*2048+0x40, SEEK_SET) or die "$0: $file: $!\n";
+read(FILE, $ibsig, 4);
+if ($ibsig ne "\xfb\xc0\x78\x70") {
+ die "$0: $file: bootloader is missing isolinux.bin hybrid signature\n".
+ "Note: isolinux-debug.bin does not support hybrid booting\n";
+}
+
# Get the total size of the image
(@imgstat = stat(FILE)) or die "$0: $file: $!\n";
$imgsize = $imgstat[7];
@@ -96,10 +104,9 @@ if ($c > 1024) {
$cc = $c;
}
-# Now $de_lba should contain the CD sector number for isolinux.bin
+# Print the MBR and partition table
seek(FILE, 0, SEEK_SET) or die "$0: $file: $!\n";
-# Print the MBR and partition table
$mbr = '';
while ( $line = <DATA> ) {
chomp $line;