summaryrefslogtreecommitdiff
path: root/utils/isohybrid.in
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-21 15:36:50 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-21 15:36:50 -0700
commite462c28ffaca0132c1761736bc93cb06a41dc7a6 (patch)
tree24edb9f85175bdd6cc30bf270f3e59571bca71ae /utils/isohybrid.in
parentd4d9f190900d31b5e9428401a0175012957d7cb7 (diff)
downloadsyslinux-e462c28ffaca0132c1761736bc93cb06a41dc7a6.tar.gz
isohybrid: support booting from partition; fix CBIOS booting
Fix CBIOS in isohybrid mode. Also allow an isohybrid image to be booted from a partition. Unfortunately this breaks compatibility between differing versions of isohybrid and isolinux.bin. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'utils/isohybrid.in')
-rw-r--r--utils/isohybrid.in13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index 2bbaada4..b3a502bc 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -43,6 +43,7 @@ use Fcntl;
'type' => [0, 255],
'id' => [0, 0xffffffff],
'hd0' => [0, 2],
+ 'partok' => [0, 1],
);
# Boolean options just set other options
@@ -50,6 +51,8 @@ use Fcntl;
'nohd0' => ['hd0', 0],
'forcehd0' => ['hd0', 1],
'ctrlhd0' => ['hd0', 2],
+ 'nopartok' => ['partok', 0],
+ 'partok' => ['partok', 1],
);
sub usage() {
@@ -63,6 +66,7 @@ sub usage() {
" -id Specify MBR ID (default random)\n",
" -forcehd0 Always assume we are loaded as disk ID 0\n",
" -ctrlhd0 Assume disk ID 0 if the Ctrl key is pressed\n",
+ " -partok Allow booting from within a partition\n";
exit 1;
}
@@ -161,9 +165,10 @@ if ($de_boot != 0x88 || $de_media != 0 ||
# 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";
+if ($ibsig ne "\xf7\xe3\xef\x0d") {
+ die "$0: $file: bootloader is missing current (3.81+) isolinux.bin\n".
+ " hybrid signature; Note that isolinux-debug.bin does not\n".
+ " support hybrid booting.\n";
}
# Get the total size of the image
@@ -202,7 +207,7 @@ if (defined($opt{'id'})) {
# Print the MBR and partition table
seek(FILE, 0, SEEK_SET) or die "$0: $file: $!\n";
-for ($i = 0; $i <= $opt{'hd0'}; $i++) {
+for ($i = 0; $i <= $opt{'hd0'}+3*$opt{'partok'}; $i++) {
$mbr = get_hex_data();
}
if ( length($mbr) > 432 ) {