[syslinux] [PATCH] isohybrid: user options

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Thu May 14 08:27:26 PDT 2009


Allow the user to define the type of partition and its number from the
command line.

The following example creates partition numer 4 with type 1c (hidden
FAT32 LBA):
  isohybrid -fstype=28 -pentry=4 hybrid.iso
---
 utils/isohybrid.in |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/utils/isohybrid.in b/utils/isohybrid.in
index 83f9dc0..d67a2b5 100644
--- a/utils/isohybrid.in
+++ b/utils/isohybrid.in
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -s
 ## -----------------------------------------------------------------------
 ##
 ##   Copyright 2002-2008 H. Peter Anvin - All Rights Reserved
@@ -19,6 +19,13 @@
 use bytes;
 use Fcntl;
 
+# Use Linux as default partition type (any better ideas?)
+# e.g.: -fstype=28 (hidden FAT32 LBA)
+our $fstype ||= 0x83;
+# Use first partition slot
+# e.g.: -pentry=4 (4th partition, as in original Zip discs)
+our $pentry ||= 1;
+
 # Use this fake geometry (zipdrive-style...)
 $h = 64; $s = 32;
 
@@ -135,8 +142,6 @@ $bcyl    = 0;
 $ehead   = $h-1;
 $esect   = $s + ((($cc-1) & 0x300) >> 2);
 $ecyl    = ($cc-1) & 0xff;
-$fstype  = 0x83;		# Linux (any better ideas?)
-$pentry  = 1;			# First partition slot
 
 for ( $i = 1 ; $i <= 4 ; $i++ ) {
     if ( $i == $pentry ) {
-- 
lfr
0/0




More information about the Syslinux mailing list