Made -boot_image isolinux activation obey -overwrite setting
This commit is contained in:
parent
2026814a80
commit
1625db8bbd
@ -66,6 +66,7 @@ then
|
|||||||
-e 's/^706k = 706kB/\ \ 706k = 706kB/' \
|
-e 's/^706k = 706kB/\ \ 706k = 706kB/' \
|
||||||
-e 's/^5540k = 5540kB/\ \ 5540k = 5540kB/' \
|
-e 's/^5540k = 5540kB/\ \ 5540k = 5540kB/' \
|
||||||
-e 's/<b>Exception processing:<\/b>/\ <BR><b>Exception processing:<\/b><BR>\ <BR>/' \
|
-e 's/<b>Exception processing:<\/b>/\ <BR><b>Exception processing:<\/b><BR>\ <BR>/' \
|
||||||
|
-e 's/<b>El Torito bootable ISO images:<\/b>/\ <BR><b>El Torito bootable ISO images:<\/b><BR>\ <BR>/' \
|
||||||
-e 's/<b>Dialog mode control:<\/b>/\ <BR><b>Dialog mode control:<\/b><BR>\ <BR>/' \
|
-e 's/<b>Dialog mode control:<\/b>/\ <BR><b>Dialog mode control:<\/b><BR>\ <BR>/' \
|
||||||
-e 's/<b>Drive and media related inquiry actions:<\/b>/\ <BR><b>Drive and media related inquiry actions:<\/b><BR>\ <BR>/' \
|
-e 's/<b>Drive and media related inquiry actions:<\/b>/\ <BR><b>Drive and media related inquiry actions:<\/b><BR>\ <BR>/' \
|
||||||
-e 's/<b>Navigation in ISO image/\ <BR><b>Navigation in ISO image/' \
|
-e 's/<b>Navigation in ISO image/\ <BR><b>Navigation in ISO image/' \
|
||||||
|
@ -53,6 +53,8 @@ Updates ISO subtrees incrementally to match given disk subtrees.
|
|||||||
Writes result either as completely new image or as add-on session
|
Writes result either as completely new image or as add-on session
|
||||||
to optical media or filesystem objects.
|
to optical media or filesystem objects.
|
||||||
.br
|
.br
|
||||||
|
Can activate ISOLINUX boot images via El Torito.
|
||||||
|
.br
|
||||||
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
||||||
.br
|
.br
|
||||||
Can restore files from ISO image to disk filesystem (see osirrox).
|
Can restore files from ISO image to disk filesystem (see osirrox).
|
||||||
@ -1352,39 +1354,55 @@ xorriso adds the traditional 300k of padding by default to all images.
|
|||||||
.br
|
.br
|
||||||
For images which will never get to a CD it is safe to use -padding 0 .
|
For images which will never get to a CD it is safe to use -padding 0 .
|
||||||
.TP
|
.TP
|
||||||
|
.B El Torito bootable ISO images:
|
||||||
|
.PP
|
||||||
|
An El Torito file object connects a boot image, which is a set of binaries
|
||||||
|
and other files 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 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. Emulation -as mkisofs supports the example options out of the
|
||||||
|
ISOLINUX wiki.
|
||||||
|
.br
|
||||||
|
The support for other boot image types is sparse.
|
||||||
|
.TP
|
||||||
\fB\-boot_image\fR "any"|"isolinux" "discard"|"keep"|"patch"|bootspec
|
\fB\-boot_image\fR "any"|"isolinux" "discard"|"keep"|"patch"|bootspec
|
||||||
Defines the handling of an eventual boot image (El-Torito) which has
|
Defines the handling of an eventual El Torito object which has
|
||||||
been read from an existing ISO image or defines how to make a prepared
|
been read from an existing ISO image or defines how to make a prepared
|
||||||
ISOLINUX file set bootable.
|
ISOLINUX file set bootable.
|
||||||
.br
|
.br
|
||||||
All types ("any") of El-Torito boot images can be discarded or kept unaltered.
|
|
||||||
|
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
|
The latter makes only sense if the format of the boot image is
|
||||||
relocatable without content changes.
|
relocatable without content changes.
|
||||||
.br
|
.br
|
||||||
An existing boot image of type "isolinux" can be
|
An existing boot image of type "isolinux" can be discarded, or it can be
|
||||||
kept unaltered (not advisable), or be discarded, or it can be patched
|
patched to match its relocation. In the latter case the resulting ISO image
|
||||||
to match its relocation. In the latter case the resulting ISO image is
|
stays bootable if the boot image was really produced by ISOLINUX.
|
||||||
bootable if the boot image was really produced by ISOLINUX.
|
|
||||||
.br
|
.br
|
||||||
CAUTION:
|
CAUTION:
|
||||||
This is an expert option.
|
This is an expert option.
|
||||||
xorriso cannot recognize the inner form of boot images.
|
xorriso cannot recognize the inner form of boot images.
|
||||||
So the user has already to know about the particular needs of the
|
So the user has already to know about the particular needs of the
|
||||||
bootimage which is present on the input media.
|
boot image which is present on the input media.
|
||||||
.br
|
.br
|
||||||
Most safe is the default: "any" "discard".
|
Most safe is the default: "any" "discard".
|
||||||
.br
|
.br
|
||||||
Regardless whether an El-Torito boot image was detected or not, it is possible
|
|
||||||
|
Regardless whether an El Torito boot image was detected or not, it is possible
|
||||||
to activate a set of ISOLINUX files for booting. An existing boot image gets
|
to activate a set of ISOLINUX files for booting. An existing boot image gets
|
||||||
discarded, then.
|
discarded, then.
|
||||||
The files have to be added to the ISO image by normal means (-map, -add, ...)
|
The files have to be added to the ISO image by normal means (image loading,
|
||||||
and should reside either in ISO image directory /isolinux or /boot/isolinux .
|
-map, -add, ...) and should reside either in ISO image directory /isolinux or
|
||||||
|
/boot/isolinux .
|
||||||
In that case it suffices to use as bootspec the text "dir=/isolinux" or
|
In that case it suffices to use as bootspec the text "dir=/isolinux" or
|
||||||
"dir=/boot/isolinux". E.g.:
|
"dir=/boot/isolinux". E.g.:
|
||||||
.br
|
.br
|
||||||
-boot_image isolinux dir=/boot/isolinux
|
-boot_image isolinux dir=/boot/isolinux
|
||||||
.br
|
.br
|
||||||
It is possible to make several individual settings. E.g.
|
It is possible to do this by several individual settings. E.g.
|
||||||
.br
|
.br
|
||||||
-boot_image isolinux bin_path=/boot/isolinux/isolinux.bin
|
-boot_image isolinux bin_path=/boot/isolinux/isolinux.bin
|
||||||
.br
|
.br
|
||||||
@ -1394,9 +1412,10 @@ It is possible to make several individual settings. E.g.
|
|||||||
.br
|
.br
|
||||||
But that should hardly be necessary.
|
But that should hardly be necessary.
|
||||||
.br
|
.br
|
||||||
CAUTION: xorriso only connects some ISOLINUX files to the El-Torito mechanism.
|
The El Torito object gets inserted into the ISO image at -commit time.
|
||||||
If the ISOLINUX setup was incorrect or if the given files are not by ISOLINUX
|
Its location is the effective cat_path= .
|
||||||
at all, then anything may happen when booting is attempted.
|
It is subject to normal -overwrite and -reassure processing if there is already
|
||||||
|
a file with the same name.
|
||||||
.TP
|
.TP
|
||||||
.B Exception processing:
|
.B Exception processing:
|
||||||
.PP
|
.PP
|
||||||
@ -1995,6 +2014,7 @@ Personality "\fBmkisofs\fR" accepts the options listed with:
|
|||||||
.br
|
.br
|
||||||
Among them: -R (always on), -J, -o, -M, -C, -path-list, -m, -exclude-list,
|
Among them: -R (always on), -J, -o, -M, -C, -path-list, -m, -exclude-list,
|
||||||
-f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points,
|
-f, -print-size, -pad, -no-pad, -V, -v, -version, -graft-points,
|
||||||
|
-no-emul-boot, -b, -c, -boot-info-table, -boot-load-size,
|
||||||
pathspecs as with xorriso -add.
|
pathspecs as with xorriso -add.
|
||||||
A lot of options are not supported and lead to failure of the mkisofs
|
A lot of options are not supported and lead to failure of the mkisofs
|
||||||
emulation. Some are ignored, but better do not rely on this tolerance.
|
emulation. Some are ignored, but better do not rely on this tolerance.
|
||||||
@ -2232,6 +2252,8 @@ Manipulating an existing ISO image on the same media
|
|||||||
.br
|
.br
|
||||||
Copy modified ISO image from one media to another
|
Copy modified ISO image from one media to another
|
||||||
.br
|
.br
|
||||||
|
Bring a prepared ISOLINUX tree onto media and make it bootable
|
||||||
|
.br
|
||||||
Operate on storage facilities other than optical drives
|
Operate on storage facilities other than optical drives
|
||||||
.br
|
.br
|
||||||
Perform multi-session runs as of cdrtools traditions
|
Perform multi-session runs as of cdrtools traditions
|
||||||
@ -2384,6 +2406,17 @@ first and only session to the output drive.
|
|||||||
.br
|
.br
|
||||||
-commit -eject all
|
-commit -eject all
|
||||||
.SS
|
.SS
|
||||||
|
.B Bring a prepared ISOLINUX tree onto media and make it bootable
|
||||||
|
The user has already created a suitable file tree on disk and copied the
|
||||||
|
ISOLINUX files into subdirectory ./boot/isolinux of that tree.
|
||||||
|
Now xorriso can burn an El Torito bootable media:
|
||||||
|
.br
|
||||||
|
\fB$\fR xorriso -outdev /dev/sr0 -blank as_needed \\
|
||||||
|
.br
|
||||||
|
-map /home/me/ISOLINUX_prepared_tree / \\
|
||||||
|
.br
|
||||||
|
-boot_image isolinux dir=/boot/isolinux
|
||||||
|
.SS
|
||||||
.B Operate on storage facilities other than optical drives
|
.B Operate on storage facilities other than optical drives
|
||||||
Full read-write operation is possible with regular files and block devices:
|
Full read-write operation is possible with regular files and block devices:
|
||||||
.br
|
.br
|
||||||
|
@ -8949,6 +8949,8 @@ not_enough_args:;
|
|||||||
} else if(strcmp(argv[i], "-iso-level")==0) {
|
} else if(strcmp(argv[i], "-iso-level")==0) {
|
||||||
i++;
|
i++;
|
||||||
/* was already handled in first argument scan */;
|
/* was already handled in first argument scan */;
|
||||||
|
} else if(strcmp(argv[i], "-no-emul-boot")==0) {
|
||||||
|
/* was already handled in first argument scan */;
|
||||||
} else if(strcmp(argv[i], "-b") == 0) {
|
} else if(strcmp(argv[i], "-b") == 0) {
|
||||||
i++;
|
i++;
|
||||||
/* was already handled in first argument scan */;
|
/* was already handled in first argument scan */;
|
||||||
@ -9673,7 +9675,7 @@ int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv,
|
|||||||
if(ret<=0 || xorriso->request_to_abort)
|
if(ret<=0 || xorriso->request_to_abort)
|
||||||
goto problem_handler;
|
goto problem_handler;
|
||||||
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
||||||
(ret>1 ? "directory" : "file"), target, source);
|
(ret>1 ? "directory" : "file"), (target[0] ? target : "/"), source);
|
||||||
if(!(flag&1))
|
if(!(flag&1))
|
||||||
Xorriso_info(xorriso, 0);
|
Xorriso_info(xorriso, 0);
|
||||||
|
|
||||||
@ -10664,7 +10666,8 @@ int Xorriso_option_cpri(struct XorrisO *xorriso, int argc, char **argv,
|
|||||||
if(ret<=0 || xorriso->request_to_abort)
|
if(ret<=0 || xorriso->request_to_abort)
|
||||||
goto problem_handler;
|
goto problem_handler;
|
||||||
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
||||||
(ret>1 ? "directory" : "file"), eff_dest, eff_origin);
|
(ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"),
|
||||||
|
eff_origin);
|
||||||
if(!(flag&1))
|
if(!(flag&1))
|
||||||
Xorriso_info(xorriso, 0);
|
Xorriso_info(xorriso, 0);
|
||||||
continue; /* regular bottom of loop */
|
continue; /* regular bottom of loop */
|
||||||
@ -11663,9 +11666,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
|
|||||||
" -boot_image \"any\"|\"isolinux\" \"discard\"|\"keep\"|\"patch\"|\"dir=\"",
|
" -boot_image \"any\"|\"isolinux\" \"discard\"|\"keep\"|\"patch\"|\"dir=\"",
|
||||||
" \"bin_path=\"|\"cat_path=\"|\"load_size=\"",
|
" \"bin_path=\"|\"cat_path=\"|\"load_size=\"",
|
||||||
" Whether to discard or keep an exiting El-Torito boot image.",
|
" Whether to discard or keep an exiting El-Torito boot image.",
|
||||||
" isolinux can be made bootable by dir=/ or dir=/isolinux",
|
" ISOLINUX can be made bootable by dir=/ or dir=/isolinux",
|
||||||
" or dir=/boot/isolinux or by bin_path=... and cat_path=...",
|
" or dir=/boot/isolinux or by bin_path=... and cat_path=...",
|
||||||
" The isolinux files need to be added to the ISO image by",
|
" The ISOLINUX files need to be added to the ISO image by",
|
||||||
" help of the usual commands like -map or -add.",
|
" help of the usual commands like -map or -add.",
|
||||||
"",
|
"",
|
||||||
" -uid uid User id to be used for the whole multi-session ISO image.",
|
" -uid uid User id to be used for the whole multi-session ISO image.",
|
||||||
@ -12443,7 +12446,8 @@ int Xorriso_option_map(struct XorrisO *xorriso, char *disk_path,
|
|||||||
|
|
||||||
if(!(flag&1)) {
|
if(!(flag&1)) {
|
||||||
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
sprintf(xorriso->info_text, "Added to ISO image: %s '%s'='%s'\n",
|
||||||
(ret>1 ? "directory" : "file"), eff_dest, eff_origin);
|
(ret>1 ? "directory" : "file"), (eff_dest[0] ? eff_dest : "/"),
|
||||||
|
eff_origin);
|
||||||
Xorriso_info(xorriso,0);
|
Xorriso_info(xorriso,0);
|
||||||
}
|
}
|
||||||
return(1);
|
return(1);
|
||||||
|
@ -107,6 +107,13 @@ Updates ISO subtrees incrementally to match given disk subtrees.
|
|||||||
Writes result as completely new image or as add-on session
|
Writes result as completely new image or as add-on session
|
||||||
to optical media or filesystem objects.
|
to optical media or filesystem objects.
|
||||||
</LI>
|
</LI>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<LI>
|
||||||
|
Can activate ISOLINUX boot images via El Torito.
|
||||||
|
</LI>
|
||||||
|
-->
|
||||||
|
|
||||||
<LI>
|
<LI>
|
||||||
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
|
||||||
</LI>
|
</LI>
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.09.28.112850"
|
#define Xorriso_timestamP "2008.09.28.113256"
|
||||||
|
@ -81,6 +81,8 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
|
|||||||
off_t img_offset, off_t disk_offset,
|
off_t img_offset, off_t disk_offset,
|
||||||
off_t bytes, int flag);
|
off_t bytes, int flag);
|
||||||
|
|
||||||
|
int Xorriso_node_from_path(struct XorrisO *xorriso, IsoImage *volume,
|
||||||
|
char *path, IsoNode **node, int flag);
|
||||||
|
|
||||||
#define LIBISO_ISDIR(node) (iso_node_get_type(node) == LIBISO_DIR)
|
#define LIBISO_ISDIR(node) (iso_node_get_type(node) == LIBISO_DIR)
|
||||||
#define LIBISO_ISREG(node) (iso_node_get_type(node) == LIBISO_FILE)
|
#define LIBISO_ISREG(node) (iso_node_get_type(node) == LIBISO_FILE)
|
||||||
@ -437,6 +439,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
|||||||
struct isoburn_read_opts *ropts= NULL;
|
struct isoburn_read_opts *ropts= NULL;
|
||||||
char adr_data[SfileadrL], *libburn_adr, *boot_fate, *sev;
|
char adr_data[SfileadrL], *libburn_adr, *boot_fate, *sev;
|
||||||
|
|
||||||
|
static int no_rr_or_joliet= 0;
|
||||||
|
|
||||||
if((flag&3)==0) {
|
if((flag&3)==0) {
|
||||||
sprintf(xorriso->info_text,
|
sprintf(xorriso->info_text,
|
||||||
"XORRISOBURN program error : Xorriso_aquire_drive bit0+bit1 not set");
|
"XORRISOBURN program error : Xorriso_aquire_drive bit0+bit1 not set");
|
||||||
@ -593,6 +597,13 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
|
|||||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* <<< */
|
||||||
|
if(no_rr_or_joliet) {
|
||||||
|
isoburn_ropt_set_extensions(ropts,
|
||||||
|
isoburn_ropt_noiso1999 | isoburn_ropt_norock | isoburn_ropt_nojoliet);
|
||||||
|
}
|
||||||
|
|
||||||
ret= isoburn_read_image(drive, ropts, &volset);
|
ret= isoburn_read_image(drive, ropts, &volset);
|
||||||
|
|
||||||
/* <<< Resetting to normal thresholds */
|
/* <<< Resetting to normal thresholds */
|
||||||
@ -852,6 +863,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
|||||||
struct burn_track **tracks;
|
struct burn_track **tracks;
|
||||||
enum burn_disc_status s;
|
enum burn_disc_status s;
|
||||||
IsoImage *image= NULL;
|
IsoImage *image= NULL;
|
||||||
|
IsoNode *node;
|
||||||
ElToritoBootImage *bootimg;
|
ElToritoBootImage *bootimg;
|
||||||
enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL;
|
enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL;
|
||||||
|
|
||||||
@ -938,6 +950,37 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
|
|||||||
cpt++;
|
cpt++;
|
||||||
strcpy(cpt, "boot.cat");
|
strcpy(cpt, "boot.cat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_bin_path,
|
||||||
|
&node, 1);
|
||||||
|
if(ret <= 0) {
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"Cannot find in ISO image: -boot_image ... bin_path=%s",
|
||||||
|
Text_shellsafe(xorriso->boot_image_bin_path, sfe, 0));
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||||
|
{ret= 0; goto ex;}
|
||||||
|
}
|
||||||
|
ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_cat_path,
|
||||||
|
&node, 1);
|
||||||
|
if(ret > 0) {
|
||||||
|
if(!xorriso->do_overwrite) {
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"May not overwite existing -boot_image ... cat_path=%s",
|
||||||
|
Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||||
|
{ret= 0; goto ex;}
|
||||||
|
}
|
||||||
|
ret= Xorriso_rmi(xorriso, NULL, (off_t) 0, xorriso->boot_image_cat_path,
|
||||||
|
8 | (xorriso->do_overwrite == 1));
|
||||||
|
if(ret != 1) {
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"Could not remove existing -boot_image cat_path=%s",
|
||||||
|
Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||||
|
{ret= 0; goto ex;}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret= iso_image_set_boot_image(image, xorriso->boot_image_bin_path,
|
ret= iso_image_set_boot_image(image, xorriso->boot_image_bin_path,
|
||||||
emul_type, xorriso->boot_image_cat_path,
|
emul_type, xorriso->boot_image_cat_path,
|
||||||
&bootimg);
|
&bootimg);
|
||||||
|
Loading…
Reference in New Issue
Block a user