New -as mkisofs options -G and --protective-msdos-label for GRUB
This commit is contained in:
parent
8d7df2b2ff
commit
df5d4a2f90
@ -9,7 +9,7 @@
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH XORRISO 1 "Mar 18, 2010"
|
||||
.TH XORRISO 1 "Apr 06, 2010"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -62,7 +62,7 @@ Updates ISO subtrees incrementally to match given disk subtrees.
|
||||
Writes result either as completely new image or as add-on session
|
||||
to optical media or filesystem objects.
|
||||
.br
|
||||
Can activate ISOLINUX boot images via El Torito.
|
||||
Can activate ISOLINUX and GRUB boot images via El Torito.
|
||||
.br
|
||||
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
||||
.br
|
||||
@ -373,10 +373,15 @@ other files stored in the ISO image, with the bootstrapping facility of
|
||||
contemporary computers.
|
||||
The content of the boot image files is not in the scope of El Torito.
|
||||
.br
|
||||
Most bootable GNU/Linux CDs are equipped with ISOLINUX boot images. xorriso is
|
||||
able to create or maintain an El Torito object which makes such an image
|
||||
bootable. For details see option -boot_image.
|
||||
Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot images.
|
||||
xorriso is able to create or maintain an El Torito object which makes such
|
||||
an image bootable. For details see option -boot_image.
|
||||
.br
|
||||
It is possible to make ISO images bootable from USB stick or other
|
||||
hard-disk-like media by -boot_image argument system_area= .
|
||||
.br
|
||||
Emulation -as mkisofs supports the example options out of the ISOLINUX wiki.
|
||||
It also supports the options used in GRUB script grub-mkrescue.
|
||||
.br
|
||||
The support for other boot image types is sparse.
|
||||
.br
|
||||
@ -596,7 +601,7 @@ by aquiring an input drive. In rare cases it is desirable to activate
|
||||
them only after image loading.
|
||||
.TP
|
||||
\fB\-load\fR entity id
|
||||
Load a particular (possibly outdated) ISO image from -dev or -indev.
|
||||
Load a particular (possibly outdated) ISO session from -dev or -indev.
|
||||
Usually all available sessions are shown with option -toc.
|
||||
.br
|
||||
entity depicts the kind of addressing. id depicts the particular
|
||||
@ -2094,30 +2099,39 @@ whole bootable system has to reside already in the first session and that
|
||||
the last session still has to bear all files which the booted system expects
|
||||
after eventually mounting the ISO image.
|
||||
.br
|
||||
If ISOLINUX is known to be present on media then it is advised to patch it
|
||||
If a boot image from ISOLINUX or GRUB is known to be present on media then
|
||||
it is advised to patch it
|
||||
when a follow-up session gets written. But one should not rely on the
|
||||
capability to influence the bootability of the existing sessions, unless one
|
||||
can assume overwriteable media.
|
||||
.TP
|
||||
\fB\-boot_image\fR "any"|"isolinux"
|
||||
\fB\-boot_image\fR "any"|"isolinux"|"grub"
|
||||
.br
|
||||
"discard"|"keep"|"patch"|"show_status"|bootspec
|
||||
.br
|
||||
Define the handling of an eventual El Torito object which has
|
||||
Define the handling of an eventual El Torito boot image object which has
|
||||
been read from an existing ISO image or define how to make a prepared
|
||||
ISOLINUX file set bootable.
|
||||
boot image file set bootable. Such file sets get produced by ISOLINUX or GRUB.
|
||||
.br
|
||||
Each -boot_image command has two arguments: type and setting. More than one
|
||||
-boot_image command may be used to define the handling. Sequence matters.
|
||||
.br
|
||||
Types "isolinux" and "grub" care for known peculiarities. Type "any" makes
|
||||
no assumptions about the origin of the boot image.
|
||||
.br
|
||||
|
||||
All types ("any") of El Torito boot images can be discarded or kept unaltered.
|
||||
The latter makes only sense if the format of the boot image is
|
||||
El Torito boot images of any type can be newly inserted, or discarded,
|
||||
or patched, or kept unaltered.
|
||||
The latter is only safe if the format of the boot image is
|
||||
relocatable without content changes.
|
||||
.br
|
||||
With any type, "show_status" will print what is known about the loaded image
|
||||
and its designated fate.
|
||||
Some boot images contain a boot info table, which needs to be patched when
|
||||
the boot image gets newly introduced into the ISO image or if an existing
|
||||
image gets relocated. This is automatically done if type "isolinux" or "grub"
|
||||
is given, but not with "any".
|
||||
.br
|
||||
An existing boot image of type "isolinux" can be discarded or it can be
|
||||
patched to match its relocation. In the latter case the resulting ISO image
|
||||
stays bootable if the boot image was really produced by ISOLINUX.
|
||||
"show_status" will print what is known about the loaded image
|
||||
and its designated fate.
|
||||
.br
|
||||
CAUTION:
|
||||
This is an expert option.
|
||||
@ -2129,16 +2143,17 @@ Most safe is the default: -boot_image "any" "discard".
|
||||
.br
|
||||
|
||||
A bootspec is a word of the form name=value and is used to describe the
|
||||
activation of a ISOLINUX boot image by an El Torito record.
|
||||
The names "dir" and "bin_path" lead to boot image activation.
|
||||
activation of a boot image by an El Torito record and eventually a MBR.
|
||||
The names "dir" and "bin_path" lead to El Torito boot image activation.
|
||||
Name "system_area" activates the given file as MBR.
|
||||
.br
|
||||
On all media types this is possible within the first session. In further
|
||||
sessions an existing boot image can get replaced by a new one, but depending
|
||||
on the media type this may have few effect at boot time. See above.
|
||||
.br
|
||||
The ISOLINUX files have to be added to the ISO image by normal means
|
||||
(image loading, -map, -add, ...) and should reside either in ISO image
|
||||
directory /isolinux or in /boot/isolinux .
|
||||
The boot image and its supporting files have to be added to the ISO image by
|
||||
normal means (image loading, -map, -add, ...). In case of ISOLINUX the files
|
||||
should reside either in ISO image directory /isolinux or in /boot/isolinux .
|
||||
In that case it suffices to use as bootspec the text "dir=/isolinux" or
|
||||
"dir=/boot/isolinux". E.g.:
|
||||
.br
|
||||
@ -2152,14 +2167,41 @@ which bundles these individual settings:
|
||||
.br
|
||||
-boot_image isolinux load_size=2048
|
||||
.br
|
||||
bin_path depicts the binary program which is to be started by the BIOS at
|
||||
boot time. It is among the files produced by ISOLINUX.
|
||||
-boot_image any boot_info_table=on
|
||||
.br
|
||||
"bin_path=" depicts the binary program which is to be started by the BIOS at
|
||||
boot time.
|
||||
.br
|
||||
An El Torito boot catalog file gets inserted into the ISO image with address
|
||||
cat_path at -commit time.
|
||||
"cat_path=" at -commit time.
|
||||
It is subject to normal -overwrite and -reassure processing if there is already
|
||||
a file with the same name.
|
||||
.br
|
||||
"load_size=" is a value which depends on the boot image. Default 2048 should
|
||||
be overridden only if a better value is known.
|
||||
.br
|
||||
"boot_info_table=on" may be used to apply patching to a boot image which
|
||||
is given by "any" "bin_path=". "boot_info_table=off" disables patching.
|
||||
.br
|
||||
"discard" gives up an existing boot image.
|
||||
.br
|
||||
"keep" keeps or copies an existing boot image unaltered.
|
||||
.br
|
||||
"patch" applies boot info table patching if an existing boot image gets copied
|
||||
to a new location.
|
||||
.br
|
||||
"system_area="disk_path copies at most 32768 bytes from the given disk file to
|
||||
the very start of the ISO image.
|
||||
This System Area is reserved for system dependent boot software, e.g. an MBR
|
||||
which can be used to boot from USB stick or hard disk.
|
||||
.br
|
||||
Other than a El Torito boot image, the file disk_path needs not to be added
|
||||
to the ISO image.
|
||||
.br
|
||||
"partition_table=on" causes a simple partition table to be written into bytes
|
||||
446 to 511 of the System Area. It shows a single partiton which starts at
|
||||
byte 512 and ends where the ISO image ends.
|
||||
.br
|
||||
.TP
|
||||
.B Character sets:
|
||||
.PP
|
||||
|
@ -4834,6 +4834,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
|
||||
m->keep_boot_image= 0;
|
||||
m->patch_isolinux_image= 0;
|
||||
m->boot_image_bin_path[0]= 0;
|
||||
m->boot_image_bin_form[0]= 0;
|
||||
m->boot_image_emul= 0;
|
||||
m->boot_image_cat_path[0]= 0;
|
||||
m->boot_image_load_size= 4 * 512; /* hearsay out of libisofs/demo/iso.c */
|
||||
@ -4844,6 +4845,8 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
|
||||
m->boot_image_isohybrid= 0;
|
||||
#endif
|
||||
|
||||
m->system_area_disk_path[0]= 0;
|
||||
m->system_area_options= 0;
|
||||
m->loaded_boot_bin_lba= 0;
|
||||
m->loaded_boot_cat_path[0]= 0;
|
||||
m->allow_graft_points= 0;
|
||||
@ -6681,7 +6684,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
||||
*/
|
||||
{
|
||||
int is_default, no_defaults, i, ret, adr_mode, bin_path_in_use= 0, do_single;
|
||||
int show_indev= 1, show_outdev= 1, show_dev= 0;
|
||||
int show_indev= 1, show_outdev= 1, show_dev= 0, patch_is_implicit= 0;
|
||||
char *line, sfe[5 * SfileadrL + 80], mode[80], *form, *treatment;
|
||||
char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt;
|
||||
char *dev_filter= NULL;
|
||||
@ -6872,45 +6875,83 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
|
||||
form= "any";
|
||||
treatment= "discard";
|
||||
if(xorriso->boot_image_bin_path[0]) {
|
||||
form= "isolinux";
|
||||
if(strcmp(xorriso->boot_image_bin_path, "/isolinux.bin") == 0 &&
|
||||
strcmp(xorriso->boot_image_cat_path, "/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/");
|
||||
else if(strcmp(xorriso->boot_image_bin_path, "/isolinux/isolinux.bin") == 0
|
||||
&& strcmp(xorriso->boot_image_cat_path, "/isolinux/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/isolinux");
|
||||
else if(strcmp(xorriso->boot_image_bin_path,
|
||||
"/boot/isolinux/isolinux.bin") == 0
|
||||
&& strcmp(xorriso->boot_image_cat_path,
|
||||
"/boot/isolinux/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/boot/isolinux");
|
||||
else {
|
||||
form= xorriso->boot_image_bin_form;
|
||||
if(strcmp(form, "isolinux") == 0) {
|
||||
patch_is_implicit= 1;
|
||||
if(strcmp(xorriso->boot_image_bin_path, "/isolinux.bin") == 0 &&
|
||||
strcmp(xorriso->boot_image_cat_path, "/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/");
|
||||
else if(strcmp(xorriso->boot_image_bin_path, "/isolinux/isolinux.bin") == 0
|
||||
&& strcmp(xorriso->boot_image_cat_path, "/isolinux/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/isolinux");
|
||||
else if(strcmp(xorriso->boot_image_bin_path,
|
||||
"/boot/isolinux/isolinux.bin") == 0
|
||||
&& strcmp(xorriso->boot_image_cat_path,
|
||||
"/boot/isolinux/boot.cat") == 0)
|
||||
strcpy(sfe, "dir=/boot/isolinux");
|
||||
else
|
||||
goto bin_path;
|
||||
treatment= sfe;
|
||||
|
||||
} else if(strcmp(form, "grub") == 0) {
|
||||
patch_is_implicit= 1;
|
||||
|
||||
/* >>> GRUB */
|
||||
goto bin_path;
|
||||
|
||||
} else {
|
||||
bin_path:;
|
||||
strcpy(sfe, "bin_path=");
|
||||
Text_shellsafe(xorriso->boot_image_bin_path, sfe + strlen(sfe), 0);
|
||||
treatment= sfe;
|
||||
bin_path_in_use= 1;
|
||||
}
|
||||
treatment= sfe;
|
||||
} else if(xorriso->patch_isolinux_image) {
|
||||
form= "isolinux";
|
||||
treatment= "patch";
|
||||
} else if(xorriso->keep_boot_image) {
|
||||
treatment= "keep";
|
||||
}
|
||||
sprintf(line,"-boot_image %s %s\n", form, treatment);
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
if(xorriso->boot_image_bin_path[0] && bin_path_in_use) {
|
||||
if(!patch_is_implicit) {
|
||||
form= "any";
|
||||
if(xorriso->patch_isolinux_image) {
|
||||
if(xorriso->boot_image_bin_path[0]) {
|
||||
form= xorriso->boot_image_bin_form;
|
||||
treatment= "boot_info_table=on";
|
||||
} else
|
||||
treatment= "patch";
|
||||
} else if(xorriso->boot_image_bin_path[0] == 0 && xorriso->keep_boot_image){
|
||||
treatment= "keep";
|
||||
} else
|
||||
treatment= "";
|
||||
sprintf(line,"-boot_image %s %s\n", form, treatment);
|
||||
if(treatment[0] && !(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
}
|
||||
if(xorriso->boot_image_cat_path[0] && bin_path_in_use) {
|
||||
is_default= 0;
|
||||
sprintf(line,"-boot_image isolinux cat_path=%s\n",
|
||||
sprintf(line,"-boot_image %s cat_path=%s\n",
|
||||
xorriso->boot_image_bin_form,
|
||||
Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
}
|
||||
if(bin_path_in_use) {
|
||||
is_default= xorriso->boot_image_load_size == 4 * 512;
|
||||
sprintf(line,"-boot_image isolinux load_size=%.f\n",
|
||||
sprintf(line,"-boot_image %s load_size=%.f\n",
|
||||
xorriso->boot_image_bin_form,
|
||||
(double) xorriso->boot_image_load_size);
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
}
|
||||
is_default= (xorriso->system_area_disk_path[0] == 0);
|
||||
sprintf(line,"-boot_image any system_area=%s\n",
|
||||
Text_shellsafe(xorriso->system_area_disk_path, sfe, 0));
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
is_default= ((xorriso->system_area_options & 1) == 0);
|
||||
sprintf(line,"-boot_image grub partition_table=%s\n",
|
||||
xorriso->system_area_options & 1 ? "on" : "off");
|
||||
if(!(is_default && no_defaults))
|
||||
Xorriso_status_result(xorriso,filter,fp,flag&2);
|
||||
|
||||
#ifdef Xorriso_with_isohybriD
|
||||
if(strcmp(form, "isolinux") == 0) {
|
||||
@ -11021,6 +11062,8 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
|
||||
" -boot-load-size # Set numbers of load sectors",
|
||||
" -no-emul-boot Boot image is 'no emulation' image",
|
||||
" -boot-info-table Patch boot image with info table",
|
||||
" -G FILE, -generic-boot FILE Set generic boot image name",
|
||||
" --protective-msdos-label Patch System Area by partition table",
|
||||
#ifdef Xorriso_with_isohybriD
|
||||
" isolinux_mbr=on|auto|off Control eventual isohybrid MBR generation",
|
||||
#endif
|
||||
@ -11144,7 +11187,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
||||
goto ex;
|
||||
option_b= 1;
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 0;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
} else if(strcmp(argv[i], "-c") == 0 ||
|
||||
strcmp(argv[i], "-eltorito-catalog") == 0) {
|
||||
if(i+1>=argc)
|
||||
@ -11168,6 +11211,17 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
|
||||
ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0);
|
||||
if(ret <= 0)
|
||||
goto problem_handler_1;
|
||||
} else if(strcmp(argv[i], "--embedded-boot")==0) {
|
||||
if(i+1>=argc)
|
||||
goto not_enough_args;
|
||||
i++;
|
||||
ret= Sfile_str(xorriso->system_area_disk_path, argv[i], 0);
|
||||
if(ret <= 0)
|
||||
{ret= -1; goto ex;}
|
||||
|
||||
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
|
||||
xorriso->system_area_options|= 1;
|
||||
|
||||
} else if(strcmp(argv[i], "-input-charset")==0) {
|
||||
if(i+1>=argc)
|
||||
goto not_enough_args;
|
||||
@ -11432,6 +11486,11 @@ not_enough_args:;
|
||||
/* was already handled in first argument scan */;
|
||||
} else if(strncmp(argv[i], "isolinux_mbr=", 13)==0) {
|
||||
/* was already handled in first argument scan */;
|
||||
} else if(strcmp(argv[i], "--embedded-boot")==0) {
|
||||
i++;
|
||||
/* was already handled in first argument scan */;
|
||||
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
|
||||
/* was already handled in first argument scan */;
|
||||
} else if(strcmp(argv[i], "-boot-load-size") == 0) {
|
||||
i++;
|
||||
/* was already handled in first argument scan */;
|
||||
@ -13531,6 +13590,207 @@ unusable_size:;
|
||||
return(1);
|
||||
}
|
||||
|
||||
#ifndef NIX
|
||||
|
||||
/* Option -boot_image */
|
||||
int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
|
||||
char *treatment, int flag)
|
||||
{
|
||||
int was_ok= 1, ret, isolinux_grub= 0;
|
||||
char *formpt, *treatpt;
|
||||
double num;
|
||||
|
||||
formpt= form;
|
||||
if(formpt[0]=='-')
|
||||
formpt++;
|
||||
treatpt= treatment;
|
||||
if(treatpt[0]=='-')
|
||||
treatpt++;
|
||||
|
||||
if(strcmp(formpt, "isolinux")==0 || strcmp(formpt, "grub") == 0)
|
||||
isolinux_grub= 1;
|
||||
if(strcmp(treatpt, "keep")==0) {
|
||||
xorriso->keep_boot_image= 1;
|
||||
xorriso->patch_isolinux_image= !!isolinux_grub;
|
||||
xorriso->boot_image_bin_path[0]= 0;
|
||||
|
||||
} else if(strcmp(treatpt, "patch")==0) {
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
xorriso->boot_image_bin_path[0]= 0;
|
||||
|
||||
} else if(strcmp(treatpt, "discard")==0) {
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 0;
|
||||
xorriso->boot_image_bin_path[0]= 0;
|
||||
|
||||
} else if(strcmp(treatpt, "show_status")==0) {
|
||||
sprintf(xorriso->result_line, "------------------------------------\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "Status of loaded boot image :\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "------------------------------------\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
Xorriso_show_boot_info(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "------------------------------------\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "Boot image settings for next commit:\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
sprintf(xorriso->result_line, "------------------------------------\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
Xorriso_status(xorriso, "-boot_image", NULL, 0);
|
||||
sprintf(xorriso->result_line, "------------------------------------\n");
|
||||
Xorriso_result(xorriso, 0);
|
||||
|
||||
} else if(strncmp(treatpt, "dir=", 4) == 0) {
|
||||
if(strcmp(formpt, "isolinux")==0) {
|
||||
/* ISOLINUX */
|
||||
/* The three locations mentioned in http://syslinux.zytor.com/iso.php */
|
||||
if(strcmp(treatpt + 4, "/") == 0)
|
||||
strcpy(xorriso->boot_image_bin_path, "/");
|
||||
else if(strcmp(treatpt + 4, "isolinux") == 0
|
||||
|| strcmp(treatpt + 4, "/isolinux") == 0)
|
||||
strcpy(xorriso->boot_image_bin_path, "/isolinux/");
|
||||
else if(strcmp(treatpt + 4, "boot/isolinux") == 0
|
||||
|| strcmp(treatpt + 4, "/boot/isolinux") == 0
|
||||
|| strcmp(treatpt + 4, "boot") == 0
|
||||
|| strcmp(treatpt + 4, "/boot") == 0)
|
||||
strcpy(xorriso->boot_image_bin_path, "/boot/isolinux/");
|
||||
else {
|
||||
sprintf(xorriso->info_text,
|
||||
"Unrecognized keyword with -boot_image %s %s",
|
||||
form, treatment);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
sprintf(xorriso->info_text,
|
||||
"Allowed with dir= are / , /isolinux . /boot/isolinux");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
|
||||
return(0);
|
||||
}
|
||||
strcpy(xorriso->boot_image_cat_path, xorriso->boot_image_bin_path);
|
||||
strcat(xorriso->boot_image_bin_path, "isolinux.bin");
|
||||
strcat(xorriso->boot_image_cat_path, "boot.cat");
|
||||
xorriso->boot_image_load_size= 4 * 512;
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
strcpy(xorriso->boot_image_bin_form, formpt);
|
||||
return(1);
|
||||
|
||||
} else if(strcmp(formpt, "grub") == 0) {
|
||||
|
||||
/* >>> GRUB */
|
||||
was_ok= 0;
|
||||
|
||||
strcpy(xorriso->boot_image_bin_form, formpt);
|
||||
|
||||
} else
|
||||
was_ok= 0;
|
||||
|
||||
} else if(strncmp(treatpt, "bin_path=", 9) == 0) {
|
||||
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9,
|
||||
xorriso->boot_image_bin_path, 2);
|
||||
if(ret <= 0)
|
||||
return(ret);
|
||||
xorriso->keep_boot_image= 0;
|
||||
if(isolinux_grub) {
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
if(xorriso->boot_image_bin_path[0])
|
||||
xorriso->boot_image_load_size= 4 * 512;
|
||||
strcpy(xorriso->boot_image_bin_form, formpt);
|
||||
} else
|
||||
strcpy(xorriso->boot_image_bin_form, "any");
|
||||
|
||||
} else if(strncmp(treatpt, "boot_info_table=", 16)==0) {
|
||||
if(strcmp(treatpt + 16, "off") == 0)
|
||||
xorriso->patch_isolinux_image= 0;
|
||||
else if(strcmp(treatpt + 16, "on") == 0)
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
else
|
||||
was_ok= 0;
|
||||
|
||||
} else if(strncmp(treatpt, "cat_path=", 9) == 0) {
|
||||
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9,
|
||||
xorriso->boot_image_cat_path, 2);
|
||||
if(ret <= 0)
|
||||
return(ret);
|
||||
|
||||
} else if(strncmp(treatpt, "load_size=", 10) == 0) {
|
||||
num= Scanf_io_size(treatpt + 10, 0);
|
||||
if(num < 512 && isolinux_grub) {
|
||||
sprintf(xorriso->info_text,
|
||||
"-boot_image %s : load_size too small (%s < 512)",
|
||||
formpt, treatpt + 10);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
xorriso->boot_image_load_size= num;
|
||||
|
||||
} else if(strncmp(treatpt, "system_area=", 12) == 0) {
|
||||
ret= Sfile_str(xorriso->system_area_disk_path, treatpt + 12, 0);
|
||||
if(ret <= 0)
|
||||
return(-1);
|
||||
|
||||
} else if(strncmp(treatpt, "partition_table=", 16)==0) {
|
||||
if(strcmp(treatpt + 16, "off") == 0)
|
||||
xorriso->system_area_options&= ~1;
|
||||
else if(strcmp(treatpt + 16, "on") == 0)
|
||||
xorriso->system_area_options|= 1;
|
||||
else
|
||||
was_ok= 0;
|
||||
|
||||
} else if(strncmp(treatpt, "isohybrid=", 10) == 0 &&
|
||||
strcmp(formpt, "isolinux")==0) {
|
||||
|
||||
#ifdef Xorriso_with_isohybriD
|
||||
|
||||
if(strcmp(treatpt + 10, "off") == 0)
|
||||
xorriso->boot_image_isohybrid= 0;
|
||||
else if(strcmp(treatpt + 10, "auto") == 0)
|
||||
xorriso->boot_image_isohybrid= 1;
|
||||
else if(strcmp(treatpt + 10, "on") == 0)
|
||||
xorriso->boot_image_isohybrid= 2;
|
||||
else if(strcmp(treatpt + 10, "force") == 0)
|
||||
xorriso->boot_image_isohybrid= 3;
|
||||
else {
|
||||
sprintf(xorriso->info_text,
|
||||
"Unrecognized keyword with -boot_image %s %s",
|
||||
form, treatment);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
sprintf(xorriso->info_text,
|
||||
"Allowed with isohybrid= are: off , auto , on , force");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
if(strcmp(treatpt + 10, "off") == 0) {
|
||||
xorriso->boot_image_isohybrid= 0;
|
||||
} else {
|
||||
sprintf(xorriso->info_text,
|
||||
"isohybrid MBR generation has been disabled on request of its inventor H. Peter Anvin on 31 Mar 2010");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
}
|
||||
|
||||
#endif /* ! Xorriso_with_isohybriD */
|
||||
|
||||
} else
|
||||
was_ok= 0;
|
||||
|
||||
/* >>> BOOT : check whether directories and/or files exist:
|
||||
bin_path , dirname(cat_path),
|
||||
isolinux.cfg in / , /isolinux , or /boot/isolinux
|
||||
*/
|
||||
|
||||
if(!was_ok) {
|
||||
sprintf(xorriso->info_text, "Unrecognized options with -boot_image: %s %s",
|
||||
form, treatment);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
#else /* ! NIX */
|
||||
|
||||
/* Option -boot_image */
|
||||
int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
|
||||
@ -13575,9 +13835,9 @@ show_status:;
|
||||
Xorriso_result(xorriso, 0);
|
||||
} else
|
||||
was_ok= 0;
|
||||
} else if(strcmp(formpt, "isolinux")==0) {
|
||||
} else if(strcmp(formpt, "isolinux")==0 || strcmp(formpt, "grub") == 0) {
|
||||
if(strcmp(treatpt, "patch")==0 ||
|
||||
strcmp(treatpt, "keep")==0) { /* no real "keep" with ISOLINUX */
|
||||
strcmp(treatpt, "keep")==0) { /* no real "keep" with ISOLINUX / GRUB */
|
||||
xorriso->keep_boot_image= 1;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
xorriso->boot_image_bin_path[0]= 0;
|
||||
@ -13588,6 +13848,10 @@ show_status:;
|
||||
} else if(strcmp(treatpt, "show_status")==0) {
|
||||
goto show_status;
|
||||
} else if(strncmp(treatpt, "dir=", 4) == 0) {
|
||||
|
||||
/* >>> GRUB */
|
||||
|
||||
/* ISOLINUX */
|
||||
/* The three locations mentioned in http://syslinux.zytor.com/iso.php */
|
||||
if(strcmp(treatpt + 4, "/") == 0)
|
||||
strcpy(xorriso->boot_image_bin_path, "/");
|
||||
@ -13614,14 +13878,14 @@ show_status:;
|
||||
strcat(xorriso->boot_image_cat_path, "boot.cat");
|
||||
xorriso->boot_image_load_size= 4 * 512;
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 0;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
} else if(strncmp(treatpt, "bin_path=", 9) == 0) {
|
||||
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9,
|
||||
xorriso->boot_image_bin_path, 2);
|
||||
if(ret <= 0)
|
||||
return(ret);
|
||||
xorriso->keep_boot_image= 0;
|
||||
xorriso->patch_isolinux_image= 0;
|
||||
xorriso->patch_isolinux_image= 1;
|
||||
if(xorriso->boot_image_bin_path[0])
|
||||
xorriso->boot_image_load_size= 4 * 512;
|
||||
} else if(strncmp(treatpt, "cat_path=", 9) == 0) {
|
||||
@ -13633,14 +13897,16 @@ show_status:;
|
||||
num= Scanf_io_size(treatpt + 10, 0);
|
||||
if(num < 512) {
|
||||
sprintf(xorriso->info_text,
|
||||
"-boot_image isolinux : load_size too small (%s < 512)",
|
||||
treatpt + 10);
|
||||
"-boot_image %s : load_size too small (%s < 512)",
|
||||
formpt, treatpt + 10);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
xorriso->boot_image_load_size= num;
|
||||
} else if(strncmp(treatpt, "isohybrid=", 10) == 0) {
|
||||
|
||||
/* >>> ISOLINUX ONLY */
|
||||
|
||||
#ifdef Xorriso_with_isohybriD
|
||||
|
||||
if(strcmp(treatpt + 10, "off") == 0)
|
||||
@ -13694,6 +13960,8 @@ show_status:;
|
||||
return(1);
|
||||
}
|
||||
|
||||
#endif /* NIX */
|
||||
|
||||
|
||||
/* Option -calm_drive */
|
||||
int Xorriso_option_calm_drive(struct XorrisO *xorriso, char *which, int flag)
|
||||
@ -16062,13 +16330,17 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
|
||||
" -compliance rule[:rule...]",
|
||||
" Allow more or less harmless deviations from strict standards",
|
||||
" compliance.",
|
||||
" -boot_image \"any\"|\"isolinux\" \"discard\"|\"keep\"|\"patch\"|\"dir=\"",
|
||||
" \"bin_path=\"|\"cat_path=\"|\"load_size=\"",
|
||||
" -boot_image \"any\"|\"isolinux\"|\"grub\"",
|
||||
" \"discard\"|\"keep\"|\"patch\"|\"dir=\"|\"bin_path=\"|\"cat_path=\"",
|
||||
" |\"load_size=\"|\"system_area=\"|\"partition_table=on|off\"",
|
||||
" Whether to discard or keep an exiting El Torito boot image.",
|
||||
" ISOLINUX can be made bootable by dir=/ or dir=/isolinux",
|
||||
" or dir=/boot/isolinux or by bin_path=... and cat_path=...",
|
||||
" The ISOLINUX files need to be added to the ISO image by",
|
||||
" help of the usual commands like -map or -add.",
|
||||
" or dir=/boot/isolinux. Others, like GRUB, by bin_path=...",
|
||||
" and cat_path=...",
|
||||
" The boot image and its helper files need to be added to the",
|
||||
" ISO image by the usual commands like -map or -add.",
|
||||
" system_area= and partition_table= are for MBR based booting",
|
||||
" from USB stick. The system_area= file needs not to be added.",
|
||||
"",
|
||||
" -uid uid User id to be used for the whole multi-session ISO image.",
|
||||
" -gid gid Group id for the same purpose.",
|
||||
|
@ -1,5 +1,5 @@
|
||||
This is xorriso.info, produced by makeinfo version 4.8 from
|
||||
./xorriso.texi.
|
||||
This is xorriso/xorriso.info, produced by makeinfo version 4.8 from
|
||||
./xorriso/xorriso.texi.
|
||||
|
||||
INFO-DIR-SECTION Archiving
|
||||
START-INFO-DIR-ENTRY
|
||||
@ -68,7 +68,7 @@ Changes file properties in the ISO image.
|
||||
Updates ISO subtrees incrementally to match given disk subtrees.
|
||||
Writes result either as completely new image or as add-on session to
|
||||
optical media or filesystem objects.
|
||||
Can activate ISOLINUX boot images via El Torito.
|
||||
Can activate ISOLINUX and GRUB boot images via El Torito.
|
||||
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
||||
Can record and restore hard links and ACL.
|
||||
Content may get zisofs compressed or filtered by external processes.
|
||||
@ -333,10 +333,13 @@ and paths of up to 1024 characters. Rock Ridge fulfills this demand.
|
||||
program plus some other files stored in the ISO image, with the
|
||||
bootstrapping facility of contemporary computers. The content of the
|
||||
boot image files is not in the scope of El Torito.
|
||||
Most bootable GNU/Linux CDs are equipped with ISOLINUX boot images.
|
||||
xorriso is able to create or maintain an El Torito object which makes
|
||||
such an image bootable. For details see option -boot_image. Emulation
|
||||
-as mkisofs supports the example options out of the ISOLINUX wiki.
|
||||
Most bootable GNU/Linux CDs are equipped with ISOLINUX or GRUB boot
|
||||
images. xorriso is able to create or maintain an El Torito object
|
||||
which makes such an image bootable. For details see option -boot_image.
|
||||
It is possible to make ISO images bootable from USB stick or other
|
||||
hard-disk-like media by -boot_image argument system_area= .
|
||||
Emulation -as mkisofs supports the example options out of the ISOLINUX
|
||||
wiki. It also supports the options used in GRUB script grub-mkrescue.
|
||||
The support for other boot image types is sparse.
|
||||
|
||||
*ACL* are an advanced way of controlling access permissions to file
|
||||
@ -569,7 +572,7 @@ image by aquiring an input drive. In rare cases it is desirable to
|
||||
activate them only after image loading.
|
||||
|
||||
-load entity id
|
||||
Load a particular (possibly outdated) ISO image from -dev or
|
||||
Load a particular (possibly outdated) ISO session from -dev or
|
||||
-indev. Usually all available sessions are shown with option -toc.
|
||||
entity depicts the kind of addressing. id depicts the particular
|
||||
address. The following entities are defined:
|
||||
@ -1889,26 +1892,35 @@ But with multi-session media CD-R[W], DVD-R[W], DVD+R, it implies that
|
||||
the whole bootable system has to reside already in the first session
|
||||
and that the last session still has to bear all files which the booted
|
||||
system expects after eventually mounting the ISO image.
|
||||
If ISOLINUX is known to be present on media then it is advised to patch
|
||||
it when a follow-up session gets written. But one should not rely on the
|
||||
capability to influence the bootability of the existing sessions,
|
||||
unless one can assume overwriteable media.
|
||||
If a boot image from ISOLINUX or GRUB is known to be present on media
|
||||
then it is advised to patch it when a follow-up session gets written.
|
||||
But one should not rely on the capability to influence the bootability
|
||||
of the existing sessions, unless one can assume overwriteable media.
|
||||
|
||||
-boot_image "any"|"isolinux"
|
||||
-boot_image "any"|"isolinux"|"grub"
|
||||
"discard"|"keep"|"patch"|"show_status"|bootspec
|
||||
Define the handling of an eventual El Torito object which has been
|
||||
read from an existing ISO image or define how to make a prepared
|
||||
ISOLINUX file set bootable.
|
||||
|
||||
All types ("any") of El Torito boot images can be discarded or
|
||||
kept unaltered. The latter makes only sense if the format of the
|
||||
boot image is relocatable without content changes.
|
||||
With any type, "show_status" will print what is known about the
|
||||
loaded image and its designated fate.
|
||||
An existing boot image of type "isolinux" can be discarded or it
|
||||
can be patched to match its relocation. In the latter case the
|
||||
resulting ISO image stays bootable if the boot image was really
|
||||
produced by ISOLINUX.
|
||||
Define the handling of an eventual El Torito boot image object
|
||||
which has been read from an existing ISO image or define how to
|
||||
make a prepared boot image file set bootable. Such file sets get
|
||||
produced by ISOLINUX or GRUB.
|
||||
Each -boot_image command has two arguments: type and setting. More
|
||||
than one -boot_image command may be used to define the handling.
|
||||
Sequence matters.
|
||||
Types "isolinux" and "grub" care for known peculiarities. Type
|
||||
"any" makes no assumptions about the origin of the boot image.
|
||||
|
||||
El Torito boot images of any type can be newly inserted, or
|
||||
discarded, or patched, or kept unaltered. The latter is only safe
|
||||
if the format of the boot image is relocatable without content
|
||||
changes.
|
||||
Some boot images contain a boot info table, which needs to be
|
||||
patched when the boot image gets newly introduced into the ISO
|
||||
image or if an existing image gets relocated. This is
|
||||
automatically done if type "isolinux" or "grub" is given, but not
|
||||
with "any".
|
||||
"show_status" will print what is known about the loaded image and
|
||||
its designated fate.
|
||||
CAUTION: This is an expert option. xorriso cannot recognize the
|
||||
inner form of boot images. So the user has already to know about
|
||||
the particular needs of the boot image which is present on the
|
||||
@ -1916,29 +1928,51 @@ unless one can assume overwriteable media.
|
||||
Most safe is the default: -boot_image "any" "discard".
|
||||
|
||||
A bootspec is a word of the form name=value and is used to
|
||||
describe the activation of a ISOLINUX boot image by an El Torito
|
||||
record. The names "dir" and "bin_path" lead to boot image
|
||||
activation.
|
||||
describe the activation of a boot image by an El Torito record and
|
||||
eventually a MBR. The names "dir" and "bin_path" lead to El
|
||||
Torito boot image activation. Name "system_area" activates the
|
||||
given file as MBR.
|
||||
On all media types this is possible within the first session. In
|
||||
further sessions an existing boot image can get replaced by a new
|
||||
one, but depending on the media type this may have few effect at
|
||||
boot time. See above.
|
||||
The ISOLINUX files have to be added to the ISO image by normal
|
||||
means (image loading, -map, -add, ...) and should reside either in
|
||||
ISO image directory /isolinux or in /boot/isolinux . In that case
|
||||
it suffices to use as bootspec the text "dir=/isolinux" or
|
||||
The boot image and its supporting files have to be added to the
|
||||
ISO image by normal means (image loading, -map, -add, ...). In
|
||||
case of ISOLINUX the files should reside either in ISO image
|
||||
directory /isolinux or in /boot/isolinux . In that case it
|
||||
suffices to use as bootspec the text "dir=/isolinux" or
|
||||
"dir=/boot/isolinux". E.g.:
|
||||
-boot_image isolinux dir=/boot/isolinux
|
||||
which bundles these individual settings:
|
||||
-boot_image isolinux bin_path=/boot/isolinux/isolinux.bin
|
||||
-boot_image isolinux cat_path=/boot/isolinux/boot.cat
|
||||
-boot_image isolinux load_size=2048
|
||||
bin_path depicts the binary program which is to be started by the
|
||||
BIOS at boot time. It is among the files produced by ISOLINUX.
|
||||
-boot_image any boot_info_table=on
|
||||
"bin_path=" depicts the binary program which is to be started by
|
||||
the BIOS at boot time.
|
||||
An El Torito boot catalog file gets inserted into the ISO image
|
||||
with address cat_path at -commit time. It is subject to normal
|
||||
with address "cat_path=" at -commit time. It is subject to normal
|
||||
-overwrite and -reassure processing if there is already a file
|
||||
with the same name.
|
||||
"load_size=" is a value which depends on the boot image. Default
|
||||
2048 should be overridden only if a better value is known.
|
||||
"boot_info_table=on" may be used to apply patching to a boot image
|
||||
which is given by "any" "bin_path=". "boot_info_table=off"
|
||||
disables patching.
|
||||
"discard" gives up an existing boot image.
|
||||
"keep" keeps or copies an existing boot image unaltered.
|
||||
"patch" applies boot info table patching if an existing boot image
|
||||
gets copied to a new location.
|
||||
"system_area="disk_path copies at most 32768 bytes from the given
|
||||
disk file to the very start of the ISO image. This System Area is
|
||||
reserved for system dependent boot software, e.g. an MBR which can
|
||||
be used to boot from USB stick or hard disk.
|
||||
Other than a El Torito boot image, the file disk_path needs not to
|
||||
be added to the ISO image.
|
||||
"partition_table=on" causes a simple partition table to be written
|
||||
into bytes 446 to 511 of the System Area. It shows a single
|
||||
partiton which starts at byte 512 and ends where the ISO image
|
||||
ends.
|
||||
|
||||
|
||||
File: xorriso.info, Node: Charset, Next: Exception, Prev: Bootable, Up: Options
|
||||
@ -3683,7 +3717,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
|
||||
|