[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: new debian-cd scripts



On Thu, May 14, 1998 at 09:09:39AM -0500, Jeff Noxon wrote:
> On Thu, May 14, 1998 at 03:03:00PM +0100, Enrique Zanardi wrote:
> > > Why not just put all the kernels on the same disc?  Bootable CDs can have
> > > multiple boot images,
> > 
> > Can they? I don't remember seeing any clue about that last time I read
> > the mkisofs or cdrecord documentation (a few months ago). How does one
> > build such a CD?
> > 
> > > and the BIOS will show a menu at boot time.  The user
> > > just picks the one that most closely resembles their hardware.
> 
> Perhaps these programs can't do it...  It's supported by the El Torito
> spec.  They would probably be easy enough features to add...

I just coded support for this from the El Torito PDF. I haven't tested it yet
"for real" (don't have access to a CD burner right now), but I think it should
be OK. These diffs are against mkhybrid-1.12a3.3 (non-Debianized source).
I included a mini readme file, but its not much documentation.

I am starting now to write a selection program which can be run from a cd
image to select which image to boot. Should be quite cool!

-- 
Tom Lees <tom@lpsg.demon.co.uk> <tom@debian.org>  http://www.lpsg.demon.co.uk/
PGP Key: finger tom@master.debian.org, http://www.lpsg.demon.co.uk/pgpkey.txt.
	New, PGP 5.0 key at http://www.lpsg.demon.co.uk/pgpkeys.asc.
diff -uNr mkhybrid-1.12a3.3/Makefile.in mkhybrid+real-eltorito/Makefile.in
--- mkhybrid-1.12a3.3/Makefile.in	Mon Apr 20 17:39:01 1998
+++ mkhybrid+real-eltorito/Makefile.in	Thu May 21 17:27:30 1998
@@ -44,7 +44,13 @@
 OBJS=mkisofs.o tree.o write.o hash.o rock.o multi.o \
 		joliet.o match.o name.o fnmatch.o eltorito.o \
 		getopt.o getopt1.o \
-		apple.o volume.o desktop.o
+		apple.o volume.o desktop.o boot.conf.tab.o boot.conf.o
+
+%.tab.c: %.y
+	bison -d $<
+
+%.c: %.l
+	flex -o$@ $<
 
 World: mkhybrid
 
diff -uNr mkhybrid-1.12a3.3/README.eltorito.2 mkhybrid+real-eltorito/README.eltorito.2
--- mkhybrid-1.12a3.3/README.eltorito.2	Thu Jan  1 01:00:00 1970
+++ mkhybrid+real-eltorito/README.eltorito.2	Wed May 20 21:59:00 1998
@@ -0,0 +1,57 @@
+README for more El Torito support hacks:
+
+The El Torito spec actually supports some quite interesting combinations for making
+a bootable CD.
+
+Instead of only supporting ONE boot image, it actually supports many, but the
+BIOS will only boot one for itself.
+
+Basically, the idea here is that this first image is a small program which then
+selects which boot image to actually use, then boots that.
+
+The spec does allow for more than this (like booting an emulated hard drive), but
+these features aren't designed for what I want to do with El Torito, or particularly
+useful to me - if you want to support them, write it for yourself!
+
+To specify a bootable CD, you now need a "boot definition file". Basically, you now
+do "-b boot.def" instead of "-b bootimage -c boot.catalog".
+
+The specific features added are:-
+
+- Support for more than one boot image
+- Support for defining boot image flags more clearly - whether the "bootable" byte should
+be set, ATAPI/SCSI support versions, etc.
+- Selection criteria support.
+- Sections, section IDs
+- Tagging an image as the default/initial
+
+Boot definition files are deliberately modelled to look like LILO configuration files.
+
+A typical boot definition file looks something like this:-
+
+catalog boot.catalog
+
+image boot/selector
+	default
+	bootable
+	executable
+
+section "Debian"
+image boot/resc1440.bin
+	atapi
+	scsi
+	not bootable
+	selection "Standard kernel"
+image boot/resc1440tecra.bin
+	atapi
+	scsi
+	not bootable
+	selection "Toshiba Tecra-fixed kernel"
+image boot/lowmem.bin
+	atapi
+	scsi
+	not bootable
+	selection "Low-memory system kernel"
+
+The "executable" option sets the "load_sectors" option to the size of the file, and also
+sets the "no_emulate" option.
diff -uNr mkhybrid-1.12a3.3/boot.conf.l mkhybrid+real-eltorito/boot.conf.l
--- mkhybrid-1.12a3.3/boot.conf.l	Thu Jan  1 01:00:00 1970
+++ mkhybrid+real-eltorito/boot.conf.l	Thu May 21 17:40:46 1998
@@ -0,0 +1,98 @@
+/* Flex parser for boot.conf files */
+%{
+#include "boot.conf.tab.h"
+
+#define STRLEN 256
+%}
+
+%option noyywrap
+
+	int num_lines = 1;
+	char c, strbuf[STRLEN], *sb;
+
+%x string
+
+%%
+
+\n		num_lines++;
+
+[ \t]*		/* eat */
+
+\"		printf ("string!\n"); BEGIN(string); sb = strbuf;
+
+<string>{
+\\.		{
+		switch (yytext[1])
+		{
+			case 't':
+			c = '\t';
+			break;
+			
+			case 'n':
+			c = '\n';
+			break;
+			
+			case '\"':
+			c = '\"';
+			break;
+			
+			default:
+			c = yytext[0];
+		}
+		}
+\"		{
+		BEGIN(INITIAL);
+		*sb='\0';
+		yylval.str = malloc (strlen (strbuf) + 1);
+		strcpy (yylval.str, strbuf);
+		printf ("string! %s\n", yylval.str);
+		return STRING;
+		}
+.		printf ("strchar %c\n", yytext[0]); *sb++ = yytext[0];
+}
+
+[^ \t\n0-9][^ \t\n]*	{
+			/* Identifier */
+			if (!strcasecmp (yytext, "catalog"))
+				return CATALOG;
+			else if (!strcasecmp (yytext, "image"))
+				return IMAGE;
+			else if (!strcasecmp (yytext, "section"))
+			{
+				printf ("section!\n");
+				return SECTION;
+			}
+			else if (!strcasecmp (yytext, "not"))
+				return NOT;
+			else if (!strcasecmp (yytext, "default"))
+				return DEFAULT;
+			else if (!strcasecmp (yytext, "bootable"))
+				return BOOTABLE;
+			else if (!strcasecmp (yytext, "atapi"))
+				return ATAPI;
+			else if (!strcasecmp (yytext, "scsi"))
+				return SCSI;
+			else if (!strcasecmp (yytext, "selection"))
+				return SELECTION;
+			else if (!strcasecmp (yytext, "load_at"))
+				return LOAD_AT;
+			else if (!strcasecmp (yytext, "all"))
+				return ALL;
+			else if (!strcasecmp (yytext, "load_length"))
+				return LOAD_LENGTH;
+			else if (!strcasecmp (yytext, "no_emulate"))
+				return NO_EMULATE;
+			else if (!strcasecmp (yytext, "executable"))
+				return EXECUTABLE;
+			sb = malloc (strlen (yytext) + 1);
+			yylval.str = sb;
+			strcpy (sb, yytext);
+			return FILENAME;
+			}
+
+([0-9]x(-?)|(-?)[0-9])[0-9]* {
+			yylval.num = strtoul (yytext, NULL, 0);
+			return ADDRESS;
+			}
+
+%%
diff -uNr mkhybrid-1.12a3.3/boot.conf.y mkhybrid+real-eltorito/boot.conf.y
--- mkhybrid-1.12a3.3/boot.conf.y	Thu Jan  1 01:00:00 1970
+++ mkhybrid+real-eltorito/boot.conf.y	Thu May 21 17:41:00 1998
@@ -0,0 +1,164 @@
+/* Bison rules for for the El Torito boot info config file */
+
+%{
+#include <stdio.h>
+#include <stdlib.h>
+#include "eltorito.h"
+
+struct eltorito_section *eltorito_section_first = NULL;
+struct eltorito_image *eltorito_image_first = NULL;
+
+struct eltorito_section *current_section;
+struct eltorito_image *current_image;
+
+char *boot_catalog = NULL;
+
+void set_catalog (char *filename);
+void new_section (char *name);
+void new_image (char *filename);
+%}
+
+/* Bison declarations */
+
+%union
+{
+	char *str;
+	int num;
+}
+
+/* keywords */
+%token		CATALOG
+%token		IMAGE
+%token		SECTION
+
+%token		NOT
+%token		DEFAULT
+%token		BOOTABLE
+%token		ATAPI
+%token		SCSI
+%token		SELECTION
+
+%token		LOAD_AT
+%token		ALL
+
+%token		LOAD_LENGTH
+
+%token		NO_EMULATE
+
+%token		EXECUTABLE
+
+%token<str>	FILENAME
+%token<str>	STRING
+%token<num>	ADDRESS
+
+%type<num>	one_flag
+
+%%		/* Grammar */
+
+config_file:	  entry_list
+		;
+
+entry_list:	  /* empty */
+		| entry_list entry
+		;
+
+entry:		  catalog_ident
+		| section_ident
+		| image_entry
+		;
+
+catalog_ident:	  CATALOG FILENAME		{ set_catalog ($2); }
+		;
+
+section_ident:	  SECTION FILENAME		{ new_section ($2); }
+		;
+
+image_entry:	  image_line flaglist
+		;
+
+image_line:	  IMAGE FILENAME		{ new_image ($2); }
+		;
+
+flaglist:	  /* empty */
+		| flaglist flag
+		;
+
+flag:		  one_flag		{ current_image->flags |= $1; }
+		| NOT one_flag		{ current_image->flags &= ~$2; }
+		| set_var
+		| EXECUTABLE		{ current_image->flags |= ELTORITO_NOEMUL;
+					  current_image->load_length = -1; }
+		;
+
+one_flag:	  ATAPI			{ $$ = ELTORITO_ATAPI; }
+		| SCSI			{ $$ = ELTORITO_SCSI; }
+		| BOOTABLE		{ $$ = ELTORITO_BOOTABLE; }
+		| DEFAULT		{ $$ = ELTORITO_DEFAULT; }
+		| NO_EMULATE		{ $$ = ELTORITO_NOEMUL; }
+		;
+
+set_var:	  LOAD_AT ADDRESS	{ current_image->load_at = $2; }
+		| SELECTION STRING	{ current_image->selection = $2; }
+		| LOAD_LENGTH ADDRESS	{ current_image->load_length = $2; }
+		| LOAD_LENGTH ALL	{ current_image->load_length = -1; }
+		;
+
+%%		/*Additional C code/End of Grammar*/
+
+void set_catalog (char *filename)
+{
+	boot_catalog = filename;
+}
+
+void new_section (char *name)
+{
+	struct eltorito_section *s;
+	
+	s = malloc (sizeof (struct eltorito_section));
+	memset (s, 0, sizeof (struct eltorito_section));
+	
+	s->section_name = name;
+	
+	if (eltorito_section_first == NULL)
+		eltorito_section_first = s;
+	else
+		current_section->next = s;
+	current_section = s;
+}
+
+void new_image (char *filename)
+{
+	struct eltorito_image *i;
+	
+	i = malloc (sizeof (struct eltorito_image));
+	memset (i, 0, sizeof (struct eltorito_image));
+	
+	i->filename = filename;
+	i->sect = current_section;
+	i->load_length = 1;
+	
+	if (eltorito_image_first == NULL)
+		eltorito_image_first = i;
+	else
+		current_image->next = i;
+	current_image = i;
+}
+
+extern int num_lines;
+
+int yyerror (char *s)
+{
+	printf ("parse error at line %d\n", num_lines);
+	exit (0);
+}
+
+extern FILE *yyin;
+extern char *boot_image_def_file;
+
+void parse_boot_config_file (void)
+{
+	yyin = fopen (boot_image_def_file, "r");
+	yyparse ();
+}
+
+/* End of file. */
diff -uNr mkhybrid-1.12a3.3/eltorito.c mkhybrid+real-eltorito/eltorito.c
--- mkhybrid-1.12a3.3/eltorito.c	Tue Jan 13 14:50:01 1998
+++ mkhybrid+real-eltorito/eltorito.c	Thu May 21 17:42:14 1998
@@ -34,12 +34,17 @@
 #include "mkisofs.h"
 #include "iso9660.h"
 
+#include "eltorito.h"
+
 #undef MIN
 #define MIN(a, b) (((a) < (b))? (a): (b))
 
 static struct eltorito_validation_entry valid_desc;
 static struct eltorito_defaultboot_entry default_desc;
 static struct eltorito_boot_descriptor boot_desc;
+static struct eltorito_sectionheader sect_head;
+static struct eltorito_sectionentry sect_entry;
+static struct eltorito_extension sect_exten;
 
 
 /*
@@ -53,6 +58,8 @@
     char		* buf;
     struct stat	  statbuf;
     
+    parse_boot_config_file ();
+    
     bootpath = (char *) e_malloc(strlen(boot_catalog)+strlen(path)+2);
     strcpy(bootpath, path);
     if (bootpath[strlen(bootpath)-1] != '/') 
@@ -119,6 +126,15 @@
     struct directory_entry      * de2;
     int				i;
     int				nsectors;
+    struct eltorito_image *ei;
+    struct eltorito_section *es;
+    char *c;
+    
+    if (eltorito_image_first == NULL)
+    {
+    	fprintf (stderr, "no boot images\n");
+    	exit (1);
+    }
     
     memset(boot_desc, 0, sizeof(*boot_desc));
     boot_desc->id[0] = 0;
@@ -141,17 +157,6 @@
 	    (unsigned int) get_733(de2->isorec.extent));
     
     /* 
-     * now adjust boot catalog
-     * lets find boot image first 
-     */
-    de=search_tree_file(root, boot_image);
-    if (!de) 
-    {
-	fprintf(stderr,"Uh oh, I cant find the boot image!\n");
-	exit(1);
-    } 
-    
-    /* 
      * we have the boot image, so write boot catalog information
      * Next we write out the primary descriptor for the disc 
      */
@@ -194,61 +199,6 @@
     set_721(valid_desc.cksum, (unsigned int) checksum);
     
     /*
-     * now make the initial/default entry for boot catalog 
-     */
-    memset(&default_desc, 0, sizeof(default_desc));
-    default_desc.boot_id[0] = EL_TORITO_BOOTABLE;
-    
-    /*
-     * use default BIOS loadpnt
-     */ 
-    set_721(default_desc.loadseg, 0);
-    default_desc.arch[0] = EL_TORITO_ARCH_x86;
-    
-    /*
-     * figure out size of boot image in sectors, for now hard code to
-     * assume 512 bytes/sector on a bootable floppy
-     */
-    nsectors = ((de->size + 511) & ~(511))/512;
-    fprintf(stderr, "\nSize of boot image is %d sectors -> ", nsectors); 
-    
-    /*
-     * choose size of emulated floppy based on boot image size 
-     */
-    if (nsectors == 2880 ) 
-    {
-	default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP;
-	fprintf(stderr, "Emulating a 1.44 meg floppy\n");
-    }
-    else if (nsectors == 5760 ) 
-    {
-	default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP;
-	fprintf(stderr,"Emulating a 2.88 meg floppy\n");
-    }
-    else if (nsectors == 2400 ) 
-    {
-	default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP;
-	fprintf(stderr,"Emulating a 1.2 meg floppy\n");
-    }
-    else 
-    {
-	fprintf(stderr,"\nError - boot image is not the an allowable size.\n");
-	exit(1);
-    }
-    
-    
-    /* 
-     * FOR NOW LOAD 1 SECTOR, JUST LIKE FLOPPY BOOT!!! 
-     */
-    nsectors = 1;
-    set_721(default_desc.nsect, (unsigned int) nsectors );
-#ifdef DEBUG_TORITO
-    fprintf(stderr,"Extent of boot images is %d\n",get_733(de->isorec.extent));
-#endif
-    set_731(default_desc.bootoff, 
-	    (unsigned int) get_733(de->isorec.extent));
-    
-    /*
      * now write it to disk 
      */
     bootcat = open(de2->whole_name, O_RDWR | O_BINARY);
@@ -263,7 +213,172 @@
      * write out 
      */
     write(bootcat, &valid_desc, 32);
-    write(bootcat, &default_desc, 32);
+    
+	/* now start writing out the boot images
+	 * first, find the initial/default entry */
+	for (ei = eltorito_image_first; ei != NULL; ei = ei->next)
+		if (ei->flags & ELTORITO_DEFAULT)
+			break;
+	
+	if (ei == NULL)
+		ei = eltorito_image_first;
+	
+	de = search_tree_file (root, ei->filename);
+	if (!de)
+	{
+		fprintf(stderr,"can't find boot image %s\n", ei->filename);
+		exit (1);
+	}
+	
+	memset (&default_desc, 0, sizeof(default_desc));
+	if (ei->flags & ELTORITO_BOOTABLE)
+		default_desc.boot_id[0] = EL_TORITO_BOOTABLE;
+	else
+		default_desc.boot_id[0] = 0;
+	set_721 (default_desc.loadseg, ei->load_at);
+	default_desc.arch[0] = EL_TORITO_ARCH_x86;
+	nsectors = ((de->size + 511) & (~511))/512;
+	printf ("size of boot image is %d sectors\n", nsectors);
+	if (!(ei->flags & ELTORITO_NOEMUL))
+	{
+		switch (nsectors)
+		{
+			case 2880:
+			default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP;
+			fprintf(stderr, "Emulating a 1.44M floppy\n");
+			break;
+			
+			case 5760:
+			default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP;
+			fprintf(stderr, "Emulating a 2.88M floppy\n");
+			break;
+			
+			case 2400:
+			default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP;
+			fprintf(stderr, "Emulating a 1.2M floppy\n");
+			break;
+			
+			default:
+			default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
+			fprintf(stderr, "Warning: not emulating any floppy drive\n");
+			break;
+		}
+	}
+	else
+		default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
+	if (ei->load_length != -1)
+		nsectors = ei->load_length;
+	set_721 (default_desc.nsect, nsectors);
+	set_721 (default_desc.bootoff, get_733 (de->isorec.extent));
+	/* Write it */
+	write(bootcat, &default_desc, 32);
+	ei->flags |= ELTORITO_DONE;
+	
+	/* Now do the sections */
+	for (es = eltorito_section_first; es != NULL; es = es->next)
+	{
+		/* Output the section header */
+		memset (&sect_head, 0, sizeof (sect_head));
+		if (es->next == NULL)
+			sect_head.headerid[0] = 0x91;
+		else
+			sect_head.headerid[0] = 0x90;
+		sect_head.arch[0] = EL_TORITO_ARCH_x86;
+		for (ei = eltorito_image_first, i = 0; ei != NULL; ei = ei->next)
+			if (!(ei->flags & ELTORITO_DONE) && ei->sect == es)
+				i++;
+		set_721 (sect_head.numsections, i);
+		memcpy_max(sect_head.idstring, es->section_name,
+			MIN(27, strlen(es->section_name)));
+		write (bootcat, &sect_head, 32);
+		
+		/* Output the section entries */
+		for (ei = eltorito_image_first; ei != NULL; ei = ei->next)
+		{
+			if ((ei->flags & ELTORITO_DONE) || ei->sect != es)
+				continue;
+			de = search_tree_file (root, ei->filename);
+			if (!de)
+			{
+				fprintf(stderr,"can't find boot image %s\n", ei->filename);
+				exit (1);
+			}
+			ei->flags |= ELTORITO_DONE;
+			if (ei->flags & ELTORITO_BOOTABLE)
+				sect_entry.boot_id[0] = EL_TORITO_BOOTABLE;
+			else
+				sect_entry.boot_id[0] = 0;
+			set_721 (sect_entry.loadseg, ei->load_at);
+			nsectors = ((de->size + 511) & (~511))/512;
+			printf ("size of boot image is %d sectors\n", nsectors);
+			if (!(ei->flags & ELTORITO_NOEMUL))
+			{
+				switch (nsectors)
+				{
+					case 2880:
+					sect_entry.media_type_flags[0] = EL_TORITO_MEDIA_144FLOP;
+					fprintf(stderr, "Emulating a 1.44M floppy\n");
+					break;
+					
+					case 5760:
+					sect_entry.media_type_flags[0] = EL_TORITO_MEDIA_288FLOP;
+					fprintf(stderr, "Emulating a 2.88M floppy\n");
+					break;
+					
+					case 2400:
+					sect_entry.media_type_flags[0] = EL_TORITO_MEDIA_12FLOP;
+					fprintf(stderr, "Emulating a 1.2M floppy\n");
+					break;
+					
+					default:
+					sect_entry.media_type_flags[0] = EL_TORITO_MEDIA_NOEMUL;
+					fprintf(stderr, "Warning: not emulating any floppy drive\n");
+					break;
+				}
+			}
+			else
+				sect_entry.media_type_flags[0] = EL_TORITO_MEDIA_NOEMUL;
+			if (ei->flags & ELTORITO_ATAPI)
+				sect_entry.media_type_flags[0] |= (1 << 6);
+			if (ei->flags & ELTORITO_SCSI)
+				sect_entry.media_type_flags[0] |= (1 << 7);
+			if (ei->load_length != -1)
+				nsectors = ei->load_length;
+			set_721 (sect_entry.nsect, nsectors);
+			set_721 (sect_entry.bootoff, get_733 (de->isorec.extent));
+			
+			if (ei->selection && strlen (ei->selection) > 18)
+				sect_entry.media_type_flags[0] |= (1 << 5);
+			
+			if (ei->selection)
+			{
+				memcpy_max(sect_entry.select, ei->selection,
+					MIN(18, strlen(ei->selection)));
+			}
+			
+			/* Write it */
+			write(bootcat, &sect_entry, 32);
+			
+			/* Make extension records */
+			if (ei->selection && strlen (ei->selection) > 18)
+			{
+				c = ei->selection - (29 - 18);
+				do
+				{
+					c += 29;
+					sect_exten.exten_id[0] = 0x44;
+					if (strlen (c) > 29)
+						sect_exten.flags[0] = (1 << 5);
+					else
+						sect_exten.flags[0] = 0;
+					memcpy_max(sect_exten.select, c,
+						MIN(29, strlen(c)));
+					write (bootcat, &sect_exten, 32);
+				} while (strlen (c) > 29);
+			}
+		}
+	}
+	/* All done */
     close(bootcat);
 } /* get_torito_desc(... */
 
diff -uNr mkhybrid-1.12a3.3/eltorito.h mkhybrid+real-eltorito/eltorito.h
--- mkhybrid-1.12a3.3/eltorito.h	Thu Jan  1 01:00:00 1970
+++ mkhybrid+real-eltorito/eltorito.h	Thu May 21 17:24:36 1998
@@ -0,0 +1,47 @@
+/*
+ * El Torito stuff header file
+ * Tom Lees, 1998
+ * GPL
+ */
+
+#ifndef ELTORITO_H
+#define ELTORITO_H
+
+struct eltorito_image
+{
+	char *selection;	/* The "selection criteria" */
+	int flags;		/* see below */
+	char *filename;
+	struct eltorito_section *sect;
+	int load_at;		/* 0 for 0x7c00 */
+	int load_length;	/* -1 for entire file, otherwise number in sectors */
+	
+	struct eltorito_image *next;
+};
+
+struct eltorito_section
+{
+	char *section_name;
+	int num_entries;
+	
+	struct eltorito_section *next;
+};
+
+/* flag bits */
+#define ELTORITO_BOOTABLE 1
+#define ELTORITO_DEFAULT 2
+#define ELTORITO_ATAPI 4
+#define ELTORITO_SCSI 8
+#define ELTORITO_NOEMUL 0x10
+#define ELTORITO_DONE 0x20
+
+extern struct eltorito_section *eltorito_section_first;
+extern struct eltorito_image *eltorito_image_first;
+
+extern void parse_boot_config_file (void);
+
+extern char *boot_catalog;
+
+#endif /* ELTORITO_H */
+
+/* End of file. */
diff -uNr mkhybrid-1.12a3.3/iso9660.h mkhybrid+real-eltorito/iso9660.h
--- mkhybrid-1.12a3.3/iso9660.h	Sat May 17 18:46:44 1997
+++ mkhybrid+real-eltorito/iso9660.h	Thu May 21 17:01:22 1998
@@ -129,6 +129,32 @@
         char pad2                       [ISODCL ( 13,   32)];
 };
 
+/* El Torito section header in boot catalog */
+struct eltorito_sectionheader {
+	char headerid			[ISODCL ( 1,     1)];
+	char arch			[ISODCL ( 2,     2)];
+	char numsections		[ISODCL ( 3,     4)];
+	char idstring			[ISODCL ( 5,    32)];
+};
+
+/* El Torito section entry in boot catalog */
+struct eltorito_sectionentry {
+	char boot_id			[ISODCL ( 1,     1)];
+	char media_type_flags		[ISODCL ( 2,     2)];
+	char loadseg			[ISODCL ( 3,     4)];
+	char arch			[ISODCL ( 5,     5)];
+	char pad1			[ISODCL ( 6,     6)];
+	char nsect			[ISODCL ( 7,     8)];
+	char bootoff			[ISODCL ( 9,    12)];
+	char select_type		[ISODCL (13,    13)];
+	char select			[ISODCL (14,    32)];
+};
+
+struct eltorito_extension {
+	char exten_id			[ISODCL ( 1,     1)];
+	char flags			[ISODCL ( 2,     2)];
+	char select			[ISODCL ( 3,    32)];
+};
 
 /* We use this to help us look up the parent inode numbers. */
 
diff -uNr mkhybrid-1.12a3.3/mkisofs.c mkhybrid+real-eltorito/mkisofs.c
--- mkhybrid-1.12a3.3/mkisofs.c	Mon May  4 18:45:55 1998
+++ mkhybrid+real-eltorito/mkisofs.c	Thu May 21 17:24:08 1998
@@ -102,8 +102,8 @@
 char * volset_id = VOLSET_ID_DEFAULT;
 char * volume_id = VOLUME_ID_DEFAULT;
 char * system_id = SYSTEM_ID_DEFAULT;
-char * boot_catalog = BOOT_CATALOG_DEFAULT;
-char * boot_image = BOOT_IMAGE_DEFAULT;
+/*char * boot_catalog = BOOT_CATALOG_DEFAULT;*/
+char * boot_image_def_file = BOOT_IMAGE_DEFAULT;
 
 int omit_period = 0;             /* Violates iso9660, but these are a pain */
 int transparent_compression = 0; /* So far only works with linux */
@@ -460,7 +460,7 @@
 "mkisofs [-o outfile] [-R] [-V volid] [-v] [-a] \
 [-T]\n [-l] [-d] [-V] [-D] [-L] [-p preparer]"
 "[-P publisher] [ -A app_id ] [-z] \n \
-[-b boot_image_name] [-c boot_catalog-name] \
+[-b boot_image_def_file_name] \
 [-x path -x path ...] path\n");
 	exit(1);
 #endif
@@ -689,21 +689,23 @@
 	all_files++;
 	break;
       case 'b':
-	use_eltorito++;
-	boot_image = optarg;  /* pathname of the boot image on cd */
-	if (boot_image == NULL) {
-	        fprintf(stderr,"Required boot image pathname missing\n");
+	if (!(use_eltorito++))
+	{
+	boot_image_def_file = optarg;  /* pathname of the boot image on cd */
+	if (boot_image_def_file == NULL) {
+	        fprintf(stderr,"Required boot image definition file pathname missing\n");
 		exit(1);
 	}
+	}
 	break;
-      case 'c':
+      /*case 'c':
 	use_eltorito++;
-	boot_catalog = optarg;  /* pathname of the boot image on cd */
-	if (boot_catalog == NULL) {
+	boot_catalog = optarg;*/  /* pathname of the boot image on cd */
+	/*if (boot_catalog == NULL) {
 	        fprintf(stderr,"Required boot catalog pathname missing\n");
 		exit(1);
 	}
-	break;
+	break;*/
       case 'A':
 	appid = optarg;
 	if(strlen(appid) > 128) {
diff -uNr mkhybrid-1.12a3.3/mkisofs.h mkhybrid+real-eltorito/mkisofs.h
--- mkhybrid-1.12a3.3/mkisofs.h	Mon May  4 13:58:14 1998
+++ mkhybrid+real-eltorito/mkisofs.h	Thu May 21 16:25:04 1998
@@ -429,8 +429,8 @@
 extern char * volset_id;
 extern char * system_id;
 extern char * volume_id;
-extern char * boot_catalog;
-extern char * boot_image;
+/*extern char * boot_catalog;*/
+extern char * boot_image_def_file;
 
 extern void * DECL(e_malloc,(size_t));
 

Reply to: