Compare commits

..

4 Commits

17 changed files with 579 additions and 1693 deletions

12
README
View File

@ -4,7 +4,7 @@
libisoburn and xorriso. By Vreixo Formoso <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Integrated sub project of libburnia-project.org.
http://files.libburnia-project.org/releases/libisoburn-0.5.6.pl00.tar.gz
http://files.libburnia-project.org/releases/libisoburn-0.5.4.pl00.tar.gz
Copyright (C) 2006-2010 Vreixo Formoso, Thomas Schmitt.
Provided under GPL version 2 or later.
------------------------------------------------------------------------------
@ -31,17 +31,17 @@ By using this software you agree to the disclaimer at the end of this text:
Compilation, First Glimpse, Installation
Dynamic library and compile time header requirements for libisoburn-0.5.6 :
Dynamic library and compile time header requirements for libisoburn-0.5.4 :
- libburn.so.4 , version libburn-0.7.8 or higher
- libisofs.so.6 , version libisofs-0.6.32 or higher
- libisofs.so.6 , version libisofs-0.6.30 or higher
libisoburn and xorriso will not start with libraries which are older than their
headers seen at compile time.
Obtain libisoburn-0.5.6.pl00.tar.gz, take it to a directory of your choice
Obtain libisoburn-0.5.4.pl00.tar.gz, take it to a directory of your choice
and do:
tar xzf libisoburn-0.5.6.pl00.tar.gz
cd libisoburn-0.5.6
tar xzf libisoburn-0.5.4.pl00.tar.gz
cd libisoburn-0.5.4
Within that directory execute:

View File

@ -1,4 +1,4 @@
AC_INIT([libisoburn], [0.5.6], [http://libburnia-project.org])
AC_INIT([libisoburn], [0.5.4], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
@ -23,7 +23,7 @@ dnl
dnl These three are only copies to provide libtool with unused LT_RELEASE
ISOBURN_MAJOR_VERSION=0
ISOBURN_MINOR_VERSION=5
ISOBURN_MICRO_VERSION=6
ISOBURN_MICRO_VERSION=4
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
@ -36,16 +36,16 @@ dnl Libtool versioning
dnl Generate libisoburn.so.1.x.y
dnl SONAME will become LT_CURRENT - LT_AGE
dnl
dnl ts B00504
dnl This is the release version 0.5.6 = libisoburn.so.1.45.0
dnl ts B00419
dnl This is the release version 0.5.4 = libisoburn.so.1.43.0
dnl ### This is the development version after above stable release
dnl LT_CURRENT++, LT_AGE++ have not happened yet.
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
dnl
dnl SONAME = 46 - 45 = 1 . Library name = libisoburn.so.1.45.0
dnl SONAME = 44 - 43 = 1 . Library name = libisoburn.so.1.43.0
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
LT_CURRENT=46
LT_AGE=45
LT_CURRENT=44
LT_AGE=43
LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
@ -257,7 +257,7 @@ AC_CHECK_HEADER(libisofs/libisofs.h)
dnl Check for proper library versions
LIBBURN_REQUIRED=0.7.8
LIBISOFS_REQUIRED=0.6.32
LIBISOFS_REQUIRED=0.6.30
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)

View File

@ -217,7 +217,7 @@ void isoburn_version(int *major, int *minor, int *micro);
*/
#define isoburn_libisofs_req_major 0
#define isoburn_libisofs_req_minor 6
#define isoburn_libisofs_req_micro 32
#define isoburn_libisofs_req_micro 30
/** The minimum version of libburn to be used with this version of libisoburn
at compile time.
@ -261,7 +261,7 @@ int isoburn_libburn_req(int *major, int *minor, int *micro);
*/
#define isoburn_header_version_major 0
#define isoburn_header_version_minor 5
#define isoburn_header_version_micro 6
#define isoburn_header_version_micro 4
/** Note:
Above version numbers are also recorded in configure.ac because libtool
wants them as parameters at build time.

View File

@ -4,7 +4,7 @@
GNU xorriso. By Thomas Schmitt <scdbackup@gmx.net>
Derived from and supported by libburnia-project.org, published via:
http://www.gnu.org/software/xorriso/xorriso_eng.html
ftp://ftp.gnu.org/gnu/xorriso/xorriso-0.5.6.tar.gz
ftp://ftp.gnu.org/gnu/xorriso/xorriso-0.5.4.tar.gz
Provided under GPL version 3 or later. No warranty.
------------------------------------------------------------------------------
@ -45,10 +45,10 @@ Optional at compile time are:
If they were present at compile time, then the optional libraries have to
be present at runtime, too.
Obtain xorriso-0.5.6.tar.gz, take it to a directory of your choice and do:
Obtain xorriso-0.5.4.tar.gz, take it to a directory of your choice and do:
tar xzf xorriso-0.5.6.tar.gz
cd xorriso-0.5.6
tar xzf xorriso-0.5.4.tar.gz
cd xorriso-0.5.4
Within that directory execute:
@ -282,9 +282,9 @@ and a matching dynamically linked xorriso binary.
This binary is leaner but depends on properly installed libraries of suitable
revision.
Dynamic library and compile time header requirements for libisoburn-0.5.4 :
Dynamic library and compile time header requirements for libisoburn-0.5.2 :
- libburn.so.4 , version libburn-0.7.8 or higher
- libisofs.so.6 , version libisofs-0.6.30 or higher
- libisofs.so.6 , version libisofs-0.6.28 or higher
libisoburn and xorriso will not start with libraries which are older than their
headers seen at compile time. So compile in the oldest possible installation
setup unless you have reason to enforce a newer bug fix level.

View File

@ -7460,7 +7460,7 @@ xorriso/configure_ac.txt
xorriso/xorriso_timestamp.h
Version leap to libisoburn-0.5.4
19 Apr 2010 [3188]
19 Apr 2010 []
xorriso/changelog.txt
Documented changes and release timestamp
@ -7477,169 +7477,8 @@ Documented changes and release timestamp
* New -find action sort_weight, new -as mkisofs --sort-weight
2010.04.19.095104 [3189]
configure.ac
README
libisoburn/libisoburn.h
xorriso/README_gnu_xorriso
xorriso/xorriso.h
xorriso/xorriso.c
xorriso/xorrisoburn.h
xorriso/xorriso_eng.html
xorriso/make_xorriso_standalone.sh
xorriso/configure_ac.txt
xorriso/xorriso_timestamp.h
Version leap to libisoburn-0.5.5
19 Apr 2010 [3190]
xorriso/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - xorriso-0.5.5 - 2010.04.19.095104
19 Apr 2010 [3191]
svn move -m Promoted branch to tag
http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveFour
http://svn.libburnia-project.org/libisoburn/tags/ZeroFiveFour
20 Apr 2010 [3192]
configure.ac
libisoburn/libisoburn.h
Requiring libisofs-0.6.31 now
2010.04.20.091732 [3193]
xorriso/xorriso_private.h
xorriso/xorriso.c
xorriso/xorrisoburn.c
New -boot_image any platform_id=
2010.04.20.103448 [3194]
xorriso/xorriso.c
Determining boot image size only after it was added to the ISO image
------------------------------------ cycle - xorriso-0.5.5 - 2010.04.20.103448
* New -boot_image any platform_id=, -as mkisofs --efi-boot
2010.04.20.140151 [3195]
xorriso/xorrisoburn.c
xorriso/xorriso.texi
xorriso/xorriso.1
xorriso/xorriso.info
Raised boot catalog weight to 1000000000
2010.04.20.142540 [3196]
xorriso/xorrisoburn.c
Changed iso_image_set_boot_platform_id() to el_torito_set_boot_platform_id()
2010.04.22.143944 [3197]
xorriso/xorriso_private.h
xorriso/xorriso.c
xorriso/xorrisoburn.c
Allowing 1 BIOS boot image and 1 EFI boot image: -boot_image grub efi_path=
2010.04.22.160615 [3198]
xorriso/xorriso.c
xorriso/xorrisoburn.c
Bug fixes and improvements of previous revision 3197
------------------------------------ cycle - xorriso-0.5.5 - 2010.04.22.160615
------------------------------------ cycle - xorriso-0.5.5 - 2010.04.22.221241
2010.04.26.121051 [3199]
xorriso/xorriso_private.h
xorriso/xorriso.c
xorriso/xorrisoburn.h
xorriso/xorrisoburn.c
xorriso/xorriso.texi
xorriso/xorriso.1
xorriso/xorriso.info
Allowing up to 32 boot images, -boot_image any id_string=, sel_crit=
2010.04.26.141229 [3200]
xorriso/xorriso.c
xorriso/xorrisoburn.c
Fixed minor problems with previous revision 3199
2010.04.26.175506 [3201]
xorriso/xorriso.c
xorriso/xorriso_eng.html
xorriso/xorriso.texi
xorriso/xorriso.1
xorriso/xorriso.info
Some documentation updates
27 Apr 2010 [3202]
xorriso/xorriso_eng.html
xorriso/xorriso.texi
xorriso/xorriso.1
xorriso/xorriso.info
Some more documentation updates
2010.04.27.072331 [3203]
xorriso/xorriso.c
Downgraded message about stdout redirection from NOTE to DEBUG
2010.04.27.074834 [3204]
xorriso/xorrisoburn.c
Fixed handling of empty current bin_path and already attached boot images
2010.04.29.133234 [3205]
xorriso/xorriso_private.h
xorriso/xorriso.c
xorriso/xorrisoburn.c
xorriso/xorriso.texi
xorriso/xorriso.1
xorriso/xorriso.info
Avoided -boot_image patching for images which obviously have no boot-info-table
------------------------------------ cycle - xorriso-0.5.5 - 2010.04.29.133234
* Allowing up to 32 boot images
* New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next
* New -as mkisofs options --efi-boot, -eltorito-alt-boot
2010.05.03.123759 [3208]
configure.ac
libisoburn/libisoburn.h
Requiring libisofs-0.6.32 now
2010.05.03.165446 [3209]
xorriso/configure_ac.txt
Adapted xorriso-standalone to version leap libisofs-0.6.33
04 May 2010 [3210]
svn copy -m Branching for libisoburn release 0.5.6
http://svn.libburnia-project.org/libisoburn/trunk
http://svn.libburnia-project.org/libisoburn/branches/ZeroFiveSix
2010.05.04.100001 [3211]
configure.ac
README
libisoburn/libisoburn.h
xorriso/README_gnu_xorriso
xorriso/xorriso.h
xorriso/xorriso.c
xorriso/xorrisoburn.h
xorriso/xorriso_eng.html
xorriso/make_xorriso_standalone.sh
xorriso/configure_ac.txt
xorriso/xorriso_timestamp.h
Version leap to libisoburn-0.5.4
[]
xorriso/changelog.txt
Documented changes and release timestamp
----------------------------------- release - xorriso-0.5.6 - 2010.05.04.100001
* Allowing up to 32 boot images
* New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next
* New -as mkisofs options --efi-boot, -eltorito-alt-boot
------------------------------------ cycle - xorriso-0.5.7 -
------------------------------------ cycle - xorriso-0.5.7 -
------------------------------------ cycle - xorriso-0.5.5 -
------------------------------------ cycle - xorriso-0.5.5 -
===============================================================================
TODO
@ -7647,21 +7486,28 @@ Documented changes and release timestamp
------------------------------------------------- For GRUB
- multi-boot management
libisofs:
- replace memory buffered boot images by filtered streams
- in eltorito_writer_compute_data_blocks():
from iso_memory_stream_new() to some filter contraption
with memorized first block and reading the rest from stream.
- let patch_boot_image() read directly from stream
(filtered or unfiltered should make no difference for the
checksum)
- warn that multiple boot images work only if they stem from
distinct disk files
libisofs:
- allow to adjust the weight of the virtual boot catalog node
(is currently 1000)
- libisofs API to control in write_validation_entry() : ve->platform_id[0] = X;
and multi-boot BIOS + EFI :
Date: Sat, 17 Apr 2010 22:30:45 +0200
From: Vladimir '?-coder/phcoder' Serbinenko <phcoder@gmail.com>
Reply-To: The development of GNU GRUB <grub-devel@gnu.org>
BIOS+EFI one should look like
Validation entry with id = 0
Default entry (BIOS). I would like that on hybrid BIOS always come in
default entry to avoid hitting BIOS bugs
Section header entry: 0x91, 0xef, 0x0001, 0, ..., 0
Section entry: 0x88, 0x00, 0x0000, 0, 0, <number of sectors in EFI boot
image>, <LBA start>, 0, ..., 0
In case of just EFI the Section header entry and Section entry become
Validation entry and default entry.
- move most of xorriso into libisoburn
- split up xorriso.c and xorrisoburn.c into smaller modules
------------------------------------------------- FreeBSD

View File

@ -3,7 +3,7 @@
# Copyright (c) 2007 - 2010 Thomas Schmitt <scdbackup@gmx.net>
# Provided under GPL version 2 or later.
AC_INIT([xorriso], [0.5.6], [http://libburnia-project.org])
AC_INIT([xorriso], [0.5.4], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
@ -23,7 +23,7 @@ AC_SUBST(BURN_MICRO_VERSION)
LIBISOFS_MAJOR_VERSION=0
LIBISOFS_MINOR_VERSION=6
LIBISOFS_MICRO_VERSION=33
LIBISOFS_MICRO_VERSION=31
AC_SUBST(LIBISOFS_MAJOR_VERSION)
AC_SUBST(LIBISOFS_MINOR_VERSION)
AC_SUBST(LIBISOFS_MICRO_VERSION)

View File

@ -10,7 +10,7 @@
# nglibisofs-develop libburn-develop libisoburn-develop
# where tarballs or repository copies have been installed of
# libisofs libburn libisoburn
# obtained according to instructions on http://libburnia-project.org.
# obtained by following instructions on http://libburnia-project.org.
#
# It creates a new directory tree
# xorriso-standalone
@ -40,7 +40,7 @@ create_gnu_xorriso="yes"
current_dir=$(pwd)
lone_dir="$current_dir"/"xorriso-standalone"
xorriso_rev=0.5.6
xorriso_rev=0.5.4
# For unstable uploads and patch level 0 of stable releases:
xorriso_pl=""
# For higher patch levels of stable releases:

View File

@ -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 "Apr 28, 2010"
.TH XORRISO 1 "Apr 18, 2010"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -368,8 +368,8 @@ demands a file name length of up to 255 characters and paths of up to 1024
characters. Rock Ridge fulfills this demand.
.PP
An \fBEl Torito\fR
boot record connects one or more boot images, which are binary program files
stored in the ISO image, with the bootstrapping facility of
boot record connects a boot image, which is a binary 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.
.br
@ -1649,9 +1649,8 @@ attributes a LBA weight number to regular files.
.br
The number may range from -2147483648 to 2147483647. The higher it is, the
lower will be the block address of the file data in the emerging ISO image.
Currently the boot catalog has a hardcoded weight of 1 billion.
Normally it should occupy the block with the lowest possible address.
Data files get added or loaded with initial weight 0.
(Currently the boot catalog has a hardcoded weight of 1000. Better keep
own weights lower than that.)
.br
E.g.: -exec sort_weight 3 --
.br
@ -2146,7 +2145,7 @@ For images which will never get to a CD it is safe to use -padding 0 .
.B El Torito bootable ISO images:
.PP
Contrary to published specifications many BIOSes will load an El Torito
record from the first session on media and not from the last one, which
object from the first session on media and not from the last one, which
gets mounted by default. This makes no problems with overwriteable media,
because they appear to inadverted readers as one single session.
.br
@ -2163,51 +2162,45 @@ can assume overwriteable media.
.TP
\fB\-boot_image\fR "any"|"isolinux"|"grub"
.br
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"show_status"|bootspec
.br
Define the handling of an eventual set of El Torito boot images which
has been read from an existing ISO image or define how to make a prepared
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.
.br
Each -boot_image command has two arguments: type and setting. More than one
-boot_image command may be used to define the handling of one or more boot
images. Sequence matters.
-boot_image command may be used to define the handling. Sequence matters.
.br
Types \fBisolinux\fR and \fBgrub\fR care for known peculiarities.
Type \fBany\fR makes
no assumptions about the origin of the boot images.
Types "isolinux" and "grub" care for known peculiarities. Type "any" makes
no assumptions about the origin of the boot image.
.br
El Torito boot images of any type can be newly inserted, or discarded,
or patched, or kept unaltered.
Whether to patch or to keep depends on whether
the boot images contain boot info tables.
The latter is only safe if the format of the boot image is
relocatable without content changes.
.br
A boot info table 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"
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
If patching is enabled, then boot images from previous sessions will
be checked whether they seem to bear a boot info table. If not,
then they stay unpatched. This check is not infallible. So if
you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
"show_status" will print what is known about the loaded image
and its designated fate.
.br
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 input media.
.br
Most safe is the default: -boot_image "any" "discard".
.br
Advised for GRUB : -boot_image "grub" "patch"
.br
For ISOLINUX : -boot_image "isolinux" "patch"
.br
\fBshow_status\fR will print what is known about the loaded boot images
and their designated fate.
.br
A \fBbootspec\fR is a word of the form name=value and is used to describe
the parameters of a boot image by an El Torito record and eventually a MBR.
The names "dir", "bin_path", "efi_path" lead to El Torito bootable images.
Name "system_area" activates a given file as MBR.
A bootspec is a word of the form name=value and is used to 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.
.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
@ -2231,54 +2224,29 @@ which bundles these individual settings:
.br
-boot_image any boot_info_table=on
.br
\fBbin_path=\fR depicts the boot image file, a binary program which is to be
started by the hardware boot facility (e.g. the BIOS) at boot time.
.br
\fBefi_path=\fR depicts a boot image file that is ready for EFI booting.
Its load_size is determined automatically, no boot info table gets
written, platform_id is 0xef.
"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
\fBcat_path=\fR 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.
The catalog lists the boot images and is read by the boot facility to choose
one of the boot images.
.br
\fBload_size=\fR is a value which depends on the boot image.
Default 2048 should be overridden only if a better value is known.
"load_size=" is a value which depends on the boot image. Default 2048 should
be overridden only if a better value is known.
.br
\fBboot_info_table=on\fR may be used to apply patching to a boot image which
"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
\fBplatform_id=\fR defines by two hex digits the Platform ID of the
boot image. "00" is 80x86 PC-BIOS, "01" is PowerPC, "02" is Mac, "ef" is EFI.
"discard" gives up an existing boot image.
.br
\fBid_string=\fRtext|56_hexdigits defines the ID string of the boot catalog
section where the boot image will be listed. If the value consists of 56
characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first
28 characters become the ID string.
The ID string of the first boot image becomes the overall catalog ID.
It is limited to 24 characters. Other id_strings become section IDs.
"keep" keeps or copies an existing boot image unaltered.
.br
\fBsel_crit=\fRhexdigits defines the Selection Criteria of the boot image.
Up to 20 bytes get read from the given characters [0-9A-Fa-f].
They get attributed to the boot image entry in the catalog.
"patch" applies boot info table patching if an existing boot image gets copied
to a new location.
.br
\fBnext\fR ends the definition of a boot image and starts a new one.
Any following -bootimage bootspecs will affect the new image.
The first "next" discards eventually loaded boot images and their
catalog.
.br
\fBdiscard\fR gives up an existing boot catalog and its boot images.
.br
\fBkeep\fR keeps or copies boot images unaltered and writes a new catalog.
.br
\fBpatch\fR applies patching to existing boot images
if they seem to bear a boot info table.
.br
\fBsystem_area=\fRdisk_path copies at most 32768 bytes from the given
disk file to the very start of the ISO image.
"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
@ -2287,13 +2255,12 @@ to the ISO image.
.br
-boot_image isolinux system_area= implies "partition_table=on".
.br
\fBpartition_table=on\fR causes a simple partition table to be written
into bytes 446 to 511 of the System Area.
"partition_table=on" causes a simple partition table to be written into bytes
446 to 511 of the System Area.
.br
With type "isolinux" it shows a partition that begins at byte 0 and it causes
the LBA of the first boot image to be written into the MBR. For the first
session this works only if also "system_area=" and "bin_path=" or "dir="
is given.
the boot image LBA to be written into the MBR. For the first session this
works only if also "system_area=" and "bin_path=" or "dir=" is given.
.br
With types "any" and "grub" it shows a single
partiton which starts at byte 512 and ends where the ISO image ends.
@ -3184,8 +3151,7 @@ of all regular files underneath directory iso_rr_path.
Adopted from grub-mkisofs are --protective-msdos-label
(see -boot_image grub partition_table=on) and
--modification-date=YYYYMMDDhhmmsscc
(see -volume_date uuid). For EFI bootable GRUB boot images use --efi-boot.
It performs -boot_image grub efi_path= surrounded by two -boot_image any next.
(see -volume_date uuid).
.br
For MBR bootable ISOLINUX images there is -isohybrid-mbr FILE, where
FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use this

View File

@ -137,7 +137,7 @@ or
#endif /* ! Xorriso_with_old_readlinE */
#endif /* Xorriso_with_readlinE */
#define TSOB_FELD(typ,anz) (typ *) calloc(1, (anz)*sizeof(typ));
#define TSOB_FELD(typ,anz) (typ *) malloc((anz)*sizeof(typ));
/* Diet facility: exclude help texts from binaries */
@ -2040,41 +2040,6 @@ overflow:;
}
int Hex_to_bin(char *hex,
int bin_size, int *bin_count, unsigned char *bin_data, int flag)
{
int i, l, acc;
l= strlen(hex);
if(l % 2 || l == 0)
return(-1); /* malformed */
*bin_count= 0;
for(i= 0; i < l; i+= 2) {
if(hex[i] >= '0' && hex[i] <= '9')
acc= (hex[i] - '0') << 4;
else if(hex[i] >= 'A' && hex[i] <= 'F')
acc= (hex[i] - 'A' + 10) << 4;
else if(hex[i] >= 'a' && hex[i] <= 'f')
acc= (hex[i] - 'a' + 10) << 4;
else
return(-1);
if(hex[i + 1] >= '0' && hex[i + 1] <= '9')
acc|= (hex[i + 1] - '0');
else if(hex[i + 1] >= 'A' && hex[i + 1] <= 'F')
acc|= (hex[i + 1] - 'A' + 10);
else if(hex[i + 1] >= 'a' && hex[i + 1] <= 'f')
acc|= (hex[i + 1] - 'a' + 10);
else
return(-1);
if(*bin_count >= bin_size)
return(0); /* overflow */
bin_data[*bin_count]= acc;
(*bin_count)++;
}
return(1);
}
#ifndef Xorriso_fileliste_externaL
/* ??? ts A71006 : Is this compatible with mkisofs pathspecs ?
@ -2927,8 +2892,6 @@ int Findjob_destroy(struct FindjoB **o, int flag)
return(0);
if(m->test_tree != NULL)
Exprnode_destroy(&(m->test_tree), 0);
if(m->start_path != NULL)
free(m->start_path);
free((char *) *o);
*o= NULL;
return(1);
@ -4923,16 +4886,12 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->dvd_obs= 0;
m->stdio_sync= 0;
m->keep_boot_image= 0;
m->boot_image_cat_path[0]= 0;
m->boot_count= 0;
m->boot_platform_id= 0x00; /* El Torito Boot Catalog Platform ID: 0 = 80x86 */
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 */
memset(m->boot_id_string, 0, sizeof(m->boot_id_string));
memset(m->boot_selection_crit, 0, sizeof(m->boot_selection_crit));
#ifdef Xorriso_with_isohybriD
m->boot_image_isohybrid= 1;
@ -4940,12 +4899,6 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->boot_image_isohybrid= 0;
#endif
m->boot_efi_default= 0;
#ifndef Xorriso_multi_booT
m->boot_image_efi_path[0]= 0;
#endif
m->system_area_disk_path[0]= 0;
m->system_area_options= 0;
m->patch_system_area= 0;
@ -6790,8 +6743,8 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
-options_from_file:${resume_state_file}_pos
*/
{
int is_default, no_defaults, i, ret, adr_mode, do_single;
int show_indev= 1, show_outdev= 1, show_dev= 0;
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, patch_is_implicit= 0;
int part_table_implicit= 0;
char *line, sfe[5 * SfileadrL + 80], mode[80], *form, *treatment;
char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt;
@ -6801,11 +6754,6 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
static int max_load_mode= 4;
struct Xorriso_lsT *paths, *leafs, *s;
#ifndef Xorriso_multi_booT
char *bin_form;
int patch_is_implicit= 0, efi_path_in_use= 0, bin_path_in_use= 0;
#endif
no_defaults= flag&1;
line= xorriso->result_line;
@ -6982,20 +6930,13 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
#ifdef Xorriso_multi_booT
Xorriso_boot_image_status(xorriso, filter, fp, flag & 3);
#else /* Xorriso_multi_booT */
is_default= (xorriso->keep_boot_image == 0
&& xorriso->patch_isolinux_image == 0
&& xorriso->boot_image_bin_path[0] == 0);
bin_form= form= "any";
form= "any";
treatment= "discard";
if(xorriso->boot_image_bin_path[0]) {
if(xorriso->boot_image_bin_form[0])
bin_form= form= xorriso->boot_image_bin_form;
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 &&
@ -7026,15 +6967,7 @@ bin_path:;
treatment= sfe;
bin_path_in_use= 1;
}
} else if(xorriso->boot_image_efi_path[0]) {
form= "grub";
strcpy(sfe, "efi_path=");
Text_shellsafe(xorriso->boot_image_efi_path, sfe + strlen(sfe), 0);
treatment= sfe;
efi_path_in_use= 1;
} else if(xorriso->patch_isolinux_image & 1) {
} else if(xorriso->patch_isolinux_image) {
treatment= "patch";
if(xorriso->patch_system_area & 1)
form= "grub";
@ -7048,45 +6981,28 @@ bin_path:;
sprintf(line,"-boot_image %s %s\n", form, treatment);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
if((xorriso->patch_isolinux_image & 1) && xorriso->boot_image_bin_path[0] &&
if(xorriso->patch_isolinux_image && xorriso->boot_image_bin_path[0] &&
!patch_is_implicit) {
sprintf(line,"-boot_image any boot_info_table=on\n");
if(!(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 %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 %s load_size=%.f\n",
bin_form, (double) xorriso->boot_image_load_size);
xorriso->boot_image_bin_form,
(double) xorriso->boot_image_load_size);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
}
if(bin_path_in_use) {
is_default= (xorriso->boot_platform_id == 0x00);
sprintf(line,"-boot_image any platform_id=0x%-2.2x\n",
(unsigned int) xorriso->boot_platform_id);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
}
if(xorriso->boot_image_efi_path[0] && xorriso->boot_image_bin_path[0]) {
strcpy(line,"-boot_image grub efi_path=");
Text_shellsafe(xorriso->boot_image_efi_path, line + strlen(line), 0);
strcat(line, "\n");
Xorriso_status_result(xorriso,filter,fp,flag&2);
efi_path_in_use= 1;
}
if(xorriso->boot_image_cat_path[0] && (bin_path_in_use || efi_path_in_use)) {
is_default= 0;
sprintf(line,"-boot_image %s cat_path=%s\n",
bin_form, Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
}
#endif /* Xorriso_multi_booT */
is_default= (xorriso->system_area_disk_path[0] == 0);
sprintf(line,"-boot_image %s system_area=%s\n",
xorriso->system_area_disk_path[0] && (xorriso->system_area_options & 2)
@ -11239,28 +11155,6 @@ no_volunteer:;
}
int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, char *whom,
int *option_b, int *no_emul_boot, int flag)
{
int ret;
if(*option_b && !*no_emul_boot) {
xorriso->boot_image_bin_path[0]= 0;
sprintf(xorriso->info_text,
"-as %s: Option -b is supported only if option -no-emul-boot is given",
whom);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
ret= Xorriso_attach_boot_image(xorriso, 0);
if(ret <= 0)
xorriso->boot_image_bin_path[0]= 0;
*option_b= 0;
*no_emul_boot= 1;
return(ret);
}
int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
{
static char helptext[][160]= {
@ -11302,8 +11196,6 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -sysid ID Set System ID",
" -b FILE, -eltorito-boot FILE",
" Set El Torito boot image name",
" -eltorito-alt-boot Start specifying alternative El Torito boot parameters",
" --efi-boot FILE Set El Torito EFI boot image name and type",
" -c FILE, -eltorito-catalog FILE",
" Set El Torito boot catalog name",
" -boot-load-size # Set numbers of load sectors",
@ -11348,10 +11240,8 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
int do_print_size= 0, fd, idx, iso_level= 0, no_emul_boot= 0;
int option_b= 0, was_failure= 0, fret, lower_r= 0, zero= 0;
int *weight_list= NULL, weight_count= 0;
int *boot_opt_list= NULL, boot_opt_count= 0;
char sfe[5*SfileadrL], adr[SfileadrL+8], ra_text[80], pathspec[2*SfileadrL];
char *ept, *add_pt, eff_path[SfileadrL], indev[SfileadrL+8], msc[80], *cpt;
char *boot_path;
static char *lower_r_args[3]= {"/", "-exec", "mkisofs_r"};
static char *sort_weight_args[4]= {"", "-exec", "sort_weight", ""};
@ -11362,12 +11252,6 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
Xorriso_no_malloc_memory(xorriso, NULL, 0);
return(-1);
}
boot_opt_list= TSOB_FELD(int, argc + 1);
if(boot_opt_list == NULL) {
cpt= (char *) weight_list;
Xorriso_no_malloc_memory(xorriso, &cpt, 0);
return(-1);
}
adr[0]= indev[0]= msc[0]= 0;
for(i= 0; i<argc; i++) {
@ -11437,42 +11321,24 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
((off_t) 4) * ((off_t) 1024*1024*1024) - ((off_t) 1);
else
xorriso->file_size_limit= 0;
#ifndef Xorriso_multi_booT
} else if(strcmp(argv[i], "-no-emul-boot")==0) {
no_emul_boot= 1;
} else if(strcmp(argv[i], "-boot-info-table")==0) {
xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0) {
strcmp(argv[i], "-eltorito-boot") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
/* >>> provisory: ts B00421
Only one BIOS boot image and one EFI boot image are possible.
Later:
Several boot images shall be kept in a list. One is the Default.
They can have type BIOS or EFI.
*/
if(strcmp(argv[i - 1], "--efi-boot") == 0) {
boot_path= xorriso->boot_image_efi_path;
xorriso->boot_efi_default= 1;
} else {
boot_path= xorriso->boot_image_bin_path;
xorriso->boot_platform_id= 0x00;
xorriso->boot_efi_default= 0;
option_b= 1;
}
boot_path[0]= 0;
xorriso->boot_image_bin_path[0]= 0;
if(argv[i][0] != '/')
strcat(boot_path, "/");
ret= Sfile_str(boot_path + strlen(boot_path), argv[i], 0);
strcat(xorriso->boot_image_bin_path, "/");
ret= Sfile_str(xorriso->boot_image_bin_path
+ strlen(xorriso->boot_image_bin_path), argv[i], 0);
if(ret <= 0)
goto ex;
option_b= 1;
xorriso->keep_boot_image= 0;
} else if(strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0) {
if(i+1>=argc)
@ -11496,9 +11362,6 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0);
if(ret <= 0)
goto problem_handler_1;
#endif /* ! Xorriso_multi_booT */
} else if(strcmp(argv[i], "-input-charset")==0) {
if(i+1>=argc)
goto not_enough_args;
@ -11580,9 +11443,6 @@ problem_handler_1:;
if(ret<=0)
goto ex;
}
#ifndef Xorriso_multi_booT
if(option_b && !no_emul_boot) {
xorriso->boot_image_bin_path[0]= 0;
sprintf(xorriso->info_text,
@ -11591,9 +11451,6 @@ problem_handler_1:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
#endif /* ! Xorriso_multi_booT */
if(was_other_option && xorriso->out_drive_handle==NULL) {
ret= Xorriso_option_dev(xorriso, "-", 2|4); /* set outdev to stdout */
if(ret<=0)
@ -11759,39 +11616,12 @@ not_enough_args:;
} else if(strcmp(argv[i], "-iso-level")==0) {
i++;
/* was already handled in first argument scan */;
#ifdef Xorriso_multi_booT
} else if(strcmp(argv[i], "-no-emul-boot")==0 ||
strcmp(argv[i], "-boot-info-table")==0 ||
strncmp(argv[i], "isolinux_mbr=", 13)==0 ||
strncmp(argv[i], "isolinux_mbr=", 13)==0 ||
strcmp(argv[i], "-eltorito-alt-boot")==0 ||
strcmp(argv[i], "--protective-msdos-label")==0) {
boot_opt_list[boot_opt_count++]= i;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0 ||
strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0 ||
strcmp(argv[i], "-boot-load-size") == 0 ||
strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-generic-boot")==0 ||
strcmp(argv[i], "-G") == 0 ||
strcmp(argv[i], "-isohybrid-mbr")==0) {
if(i+1>=argc)
goto not_enough_args;
boot_opt_list[boot_opt_count++]= i;
i++;
#else /* Xorriso_multi_booT */
} else if(strcmp(argv[i], "-no-emul-boot")==0) {
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0) {
strcmp(argv[i], "-eltorito-boot") == 0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0) {
i++;
@ -11810,21 +11640,17 @@ not_enough_args:;
goto ex;
if(strcmp(argv[i - 1], "-isohybrid-mbr")==0)
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 2;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 1;
} else if(strncmp(argv[i], "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argv[i] + 20, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-boot-load-size") == 0) {
i++;
/* was already handled in first argument scan */;
} else if(strcmp(argv[i], "-boot-info-table")==0) {
;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 1;
#endif /* ! Xorriso_multi_booT */
} else if(strncmp(argv[i], "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argv[i] + 20, 0);
if(ret <= 0)
goto problem_handler_1;
} else if(strcmp(argv[i], "-input-charset")==0) {
i++;
/* was already handled in first argument scan */;
@ -11916,118 +11742,10 @@ problem_handler_2:;
sort_weight_args[0]= argv[i + 2];
sort_weight_args[3]= argv[i + 1];
ret= Xorriso_option_find(xorriso, 4, sort_weight_args, &zero, 2);
if(ret > 0)
continue;
/* Problem handler */
was_failure= 1;
fret= Xorriso_eval_problem_status(xorriso, ret, 1|2);
if(fret>=0)
continue;
goto ex;
}
#ifdef Xorriso_multi_booT
/* After all pathspecs are added: perform boot related options */
for(j= 0; j < boot_opt_count; j++) {
i= boot_opt_list[j];
if(strcmp(argv[i], "-no-emul-boot")==0) {
no_emul_boot= 1;
} else if(strcmp(argv[i], "-boot-info-table")==0) {
xorriso->patch_isolinux_image= 1;
} else if(strcmp(argv[i], "-b") == 0 ||
strcmp(argv[i], "-eltorito-boot") == 0 ||
strcmp(argv[i], "--efi-boot") == 0) {
i++;
if(strcmp(argv[i - 1], "--efi-boot") == 0) {
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &no_emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
}
boot_path= xorriso->boot_image_bin_path;
xorriso->boot_efi_default= 1;
} else {
boot_path= xorriso->boot_image_bin_path;
xorriso->boot_platform_id= 0x00;
xorriso->boot_efi_default= 0;
option_b= 1;
}
boot_path[0]= 0;
if(argv[i][0] != '/')
strcat(boot_path, "/");
ret= Sfile_str(boot_path + strlen(boot_path), argv[i], 0);
if(ret <= 0)
goto ex;
if(xorriso->boot_efi_default && xorriso->boot_image_bin_path[0]) {
option_b= 0;
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &no_emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
}
xorriso->keep_boot_image= 0;
} else if(strcmp(argv[i], "-c") == 0 ||
strcmp(argv[i], "-eltorito-catalog") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
xorriso->boot_image_cat_path[0]= 0;
if(argv[i][0] != '/')
strcat(xorriso->boot_image_cat_path, "/");
ret= Sfile_str(xorriso->boot_image_cat_path
+ strlen(xorriso->boot_image_cat_path), argv[i], 0);
if(ret <= 0)
goto ex;
} else if(strcmp(argv[i], "-boot-load-size") == 0) {
if(i+1>=argc)
goto not_enough_args;
i++;
sscanf(argv[i], "%d", &ret);
xorriso->boot_image_load_size= ret * 512;
} else if(strncmp(argv[i], "isolinux_mbr=", 13)==0) {
sprintf(sfe, "isohybrid=%s", argv[i] + 13);
ret= Xorriso_option_boot_image(xorriso, "isolinux", sfe, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "-eltorito-alt-boot")==0) {
ret= Xorriso_genisofs_add_boot(xorriso, whom,
&option_b, &no_emul_boot, 0);
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argv[i], "--embedded-boot")==0 ||
strcmp(argv[i], "-generic-boot")==0 ||
strcmp(argv[i], "-G") == 0 ||
strcmp(argv[i], "-isohybrid-mbr")==0) {
if(i+1>=argc)
goto not_enough_args;
i++;
ret= Xorriso_set_system_area_path(xorriso, argv[i], 0);
if(ret <= 0)
goto problem_handler_boot;
if(strcmp(argv[i - 1], "-isohybrid-mbr")==0)
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 2;
} else if(strcmp(argv[i], "--protective-msdos-label")==0) {
xorriso->system_area_options= (xorriso->system_area_options & ~3) | 1;
}
continue; /* regular bottom of loop */
problem_handler_boot:;
/* Problem handler */
was_failure= 1;
fret= Xorriso_eval_problem_status(xorriso, ret, 1|2);
if(fret>=0)
continue;
goto ex;
}
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_genisofs_add_boot(xorriso, whom, &option_b, &no_emul_boot, 0);
if(ret <= 0)
if(ret<=0)
goto ex;
}
#endif /* Xorriso_multi_booT */
ret= !was_failure;
ex:;
if(was_path && !do_print_size)
@ -12037,8 +11755,6 @@ ex:;
Xorriso_option_rollback(xorriso, 0);
if(weight_list != NULL)
free(weight_list);
if(boot_opt_list != NULL)
free(boot_opt_list);
return(ret);
}
@ -14059,13 +13775,13 @@ 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, count;
unsigned int u;
int was_ok= 1, ret, isolinux_grub= 0;
char *formpt, *treatpt;
double num;
@ -14079,31 +13795,18 @@ int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
if(strcmp(formpt, "isolinux")==0 || strcmp(formpt, "grub") == 0)
isolinux_grub= 1;
if(strcmp(treatpt, "keep")==0) {
if(xorriso->boot_count > 0) {
cannot_keep_or_patch:;
sprintf(xorriso->info_text,
"Loaded boot image has already been replaced. Cannot keep or patch it.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(isolinux_grub)
goto treatment_patch;
xorriso->keep_boot_image= 1;
xorriso->patch_isolinux_image= 0;
xorriso->patch_isolinux_image= !!isolinux_grub;
xorriso->boot_image_bin_path[0]= 0;
xorriso->patch_system_area= 0;
} else if(strcmp(treatpt, "patch")==0) {
treatment_patch:;
if(xorriso->boot_count > 0)
goto cannot_keep_or_patch;
xorriso->keep_boot_image= 0;
xorriso->patch_isolinux_image= 1;
xorriso->boot_image_bin_path[0]= 0;
if(strcmp(formpt, "grub") == 0) {
xorriso->patch_isolinux_image|= 2;
if(strcmp(formpt, "grub")==0)
xorriso->patch_system_area= 1;
} else if(strcmp(formpt, "isolinux") == 0)
else if(strcmp(formpt, "isolinux")==0)
xorriso->patch_system_area= 2;
else
xorriso->patch_system_area= 0;
@ -14113,16 +13816,6 @@ treatment_patch:;
xorriso->patch_isolinux_image= 0;
xorriso->boot_image_bin_path[0]= 0;
xorriso->patch_system_area= 0;
if(xorriso->boot_count > 0) {
ret= Xorriso_attach_boot_image(xorriso, 2); /* dispose boot images */
if(ret <= 0)
return(ret);
}
} else if(strcmp(treatpt, "next") == 0) {
ret= Xorriso_attach_boot_image(xorriso, 0);
if(ret <= 0)
return(ret);
} else if(strcmp(treatpt, "show_status")==0) {
sprintf(xorriso->result_line, "------------------------------------\n");
@ -14142,14 +13835,6 @@ treatment_patch:;
sprintf(xorriso->result_line, "------------------------------------\n");
Xorriso_result(xorriso, 0);
} else if(strcmp(treatpt, "cat_path=") == 0) {
xorriso->boot_image_cat_path[0] = 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, "dir=", 4) == 0) {
if(strcmp(formpt, "isolinux")==0) {
/* ISOLINUX */
@ -14193,9 +13878,6 @@ treatment_patch:;
} else
was_ok= 0;
} else if(strcmp(treatpt, "bin_path=") == 0) {
xorriso->boot_image_bin_path[0] = 0;
xorriso->boot_efi_default= 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);
@ -14209,40 +13891,21 @@ treatment_patch:;
strcpy(xorriso->boot_image_bin_form, formpt);
} else
strcpy(xorriso->boot_image_bin_form, "any");
xorriso->boot_efi_default= 0;
#ifdef Xorriso_multi_booT
} else if(strcmp(treatpt, "efi_path=") == 0) {
xorriso->boot_image_bin_path[0] = 0;
xorriso->boot_efi_default= 0;
} else if(strncmp(treatpt, "efi_path=", 9) == 0) {
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9,
xorriso->boot_image_bin_path, 2);
#else
} else if(strcmp(treatpt, "efi_path=") == 0) {
xorriso->boot_image_efi_path[0] = 0;
} else if(strncmp(treatpt, "efi_path=", 9) == 0) {
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, treatpt + 9,
xorriso->boot_image_efi_path, 2);
#endif /* ! Xorriso_multi_booT */
if(ret <= 0)
return(ret);
xorriso->keep_boot_image= 0;
xorriso->boot_efi_default= 1;
} 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 | (2 * (strcmp(treatpt, "grub") == 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) {
@ -14254,27 +13917,6 @@ treatment_patch:;
}
xorriso->boot_image_load_size= num;
} else if(strncmp(treatpt, "id_string=", 10) == 0) {
memset(xorriso->boot_id_string, 0, 29);
if(strlen(treatpt + 10) == 56) {
ret= Hex_to_bin(treatpt + 10, 28, &count, xorriso->boot_id_string, 0);
} else
ret= 0;
if(ret <= 0)
strncpy((char *) xorriso->boot_id_string, treatpt + 10, 28);
} else if(strncmp(treatpt, "sel_crit=", 9) == 0) {
memset(xorriso->boot_selection_crit, 0, 21);
count= 0;
ret= Hex_to_bin(treatpt + 9, 20, &count, xorriso->boot_selection_crit, 0);
if(ret <= 0) {
sprintf(xorriso->info_text,
"-boot_image %s sel_crit= : Wrong form. Need even number of hex digits.",
formpt);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
} else if(strncmp(treatpt, "system_area=", 12) == 0) {
ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0);
if(ret <= 0)
@ -14296,20 +13938,6 @@ treatment_patch:;
} else
was_ok= 0;
} else if(strncmp(treatpt, "platform_id=", 12)==0) {
if(strncmp(treatpt + 12, "0x", 2) == 0)
sscanf(treatpt + 14, "%x", &u);
else
sscanf(treatpt + 12, "%u", &u);
if(u > 0xff) {
sprintf(xorriso->info_text,
"-boot_image %s : platform_id too large (%s > 0xff)",
formpt, treatpt + 12);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
xorriso->boot_platform_id= u;
} else if(strncmp(treatpt, "isohybrid=", 10) == 0 &&
strcmp(formpt, "isolinux")==0) {
@ -14342,9 +13970,6 @@ treatment_patch:;
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);
sprintf(xorriso->info_text,
"It has been replaced by -boot_image isolinux system_area=External-File");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
}
#endif /* ! Xorriso_with_isohybriD */
@ -14352,6 +13977,11 @@ treatment_patch:;
} 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);
@ -14361,6 +13991,178 @@ treatment_patch:;
return(1);
}
#else /* ! NIX */
/* Option -boot_image */
int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
char *treatment, int flag)
{
int was_ok= 1, ret;
char *formpt, *treatpt;
double num;
formpt= form;
if(formpt[0]=='-')
formpt++;
treatpt= treatment;
if(treatpt[0]=='-')
treatpt++;
if(strcmp(formpt, "any")==0) {
if(strcmp(treatpt, "keep")==0) {
xorriso->keep_boot_image= 1;
xorriso->patch_isolinux_image= 0;
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) {
show_status:;
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
was_ok= 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 / GRUB */
xorriso->keep_boot_image= 1;
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) {
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, "/");
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;
} 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= 1;
if(xorriso->boot_image_bin_path[0])
xorriso->boot_image_load_size= 4 * 512;
} 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) {
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, "isohybrid=", 10) == 0) {
/* >>> ISOLINUX ONLY */
#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;
} 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);
}
#endif /* NIX */
/* Option -calm_drive */
int Xorriso_option_calm_drive(struct XorrisO *xorriso, char *which, int flag)
@ -21280,12 +21082,12 @@ protect_stdout:;
Xorriso_protect_stdout(xorriso, 0);
sprintf(xorriso->info_text,
"Encountered - or stdio:/dev/fd/1 as possible write target.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
sprintf(xorriso->info_text,
"Redirecting nearly all text message output to stderr.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
sprintf(xorriso->info_text, "Disabling use of libreadline.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} else if(strcmp(cmd,"abort_on")==0 && was_dashed == 1) {
i++;
@ -21418,7 +21220,7 @@ char *Xorriso__get_patch_level_text(int flag)
/* xorriso consists only of a main() stub which has an own version to match
the version of libxorriso header and runtime code.
*/
#define Xorriso_main_program_versioN "0.5.6"
#define Xorriso_main_program_versioN "0.5.4"
#else /* Xorriso_without_subS */

View File

@ -16,7 +16,7 @@
struct XorrisO;
#define Xorriso_program_versioN "0.5.6"
#define Xorriso_program_versioN "0.5.4"
#define Xorriso_program_patch_leveL ""

View File

@ -329,8 +329,8 @@ characters of filename length. It is the X/Open System Interface
standard XSI which demands a file name length of up to 255 characters
and paths of up to 1024 characters. Rock Ridge fulfills this demand.
An *El Torito* boot record connects one or more boot images, which
are binary program files stored in the ISO image, with the
An *El Torito* boot record connects a boot image, which is a binary
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 or GRUB boot
@ -1486,10 +1486,9 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Options
attributes a LBA weight number to regular files.
The number may range from -2147483648 to 2147483647. The
higher it is, the lower will be the block address of the file
data in the emerging ISO image. Currently the boot catalog
has a hardcoded weight of 1 billion. Normally it should
occupy the block with the lowest possible address. Data
files get added or loaded with initial weight 0.
data in the emerging ISO image. (Currently the boot catalog
has a hardcoded weight of 1000. Better keep own weights lower
than that.)
E.g.: -exec sort_weight 3 --
show_stream
shows the content stream chain of a data file.
@ -1927,7 +1926,7 @@ File: xorriso.info, Node: Bootable, Next: Charset, Prev: SetWrite, Up: Optio
==================================
Contrary to published specifications many BIOSes will load an El Torito
record from the first session on media and not from the last one, which
object from the first session on media and not from the last one, which
gets mounted by default. This makes no problems with overwriteable
media, because they appear to inadverted readers as one single session.
But with multi-session media CD-R[W], DVD-R[W], DVD+R, it implies that
@ -1940,41 +1939,40 @@ 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"|"grub"
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"show_status"|bootspec
Define the handling of an eventual set of El Torito boot images
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 of
one or more boot images. Sequence matters.
Types *isolinux* and *grub* care for known peculiarities. Type
*any* makes no assumptions about the origin of the boot images.
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. Whether to patch or to
keep depends on whether the boot images contain boot info tables.
A boot info table 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".
If patching is enabled, then boot images from previous sessions
will be checked whether they seem to bear a boot info table. If
not, then they stay unpatched. This check is not infallible. So if
you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
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
input media.
Most safe is the default: -boot_image "any" "discard".
Advised for GRUB : -boot_image "grub" "patch"
For ISOLINUX : -boot_image "isolinux" "patch"
*show_status* will print what is known about the loaded boot images
and their designated fate.
A *bootspec* is a word of the form name=value and is used to
describe the parameters of a boot image by an El Torito record and
eventually a MBR. The names "dir", "bin_path", "efi_path" lead to
El Torito bootable images. Name "system_area" activates a given
file as MBR.
A bootspec is a word of the form name=value and is used to
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
@ -1991,57 +1989,34 @@ of the existing sessions, unless one can assume overwriteable media.
-boot_image isolinux cat_path=/boot/isolinux/boot.cat
-boot_image isolinux load_size=2048
-boot_image any boot_info_table=on
*bin_path=* depicts the boot image file, a binary program which is
to be started by the hardware boot facility (e.g. the BIOS) at
boot time.
*efi_path=* depicts a boot image file that is ready for EFI
booting. Its load_size is determined automatically, no boot info
table gets written, platform_id is 0xef.
"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. The catalog lists the boot images and is read
by the boot facility to choose one of the boot images.
*load_size=* is a value which depends on the boot image. Default
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
"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.
*platform_id=* defines by two hex digits the Platform ID of the
boot image. "00" is 80x86 PC-BIOS, "01" is PowerPC, "02" is Mac,
"ef" is EFI.
*id_string=*text|56_hexdigits defines the ID string of the boot
catalog section where the boot image will be listed. If the value
consists of 56 characters [0-9A-Fa-f] then it is converted into 28
bytes, else the first 28 characters become the ID string. The ID
string of the first boot image becomes the overall catalog ID. It
is limited to 24 characters. Other id_strings become section IDs.
*sel_crit=*hexdigits defines the Selection Criteria of the boot
image. Up to 20 bytes get read from the given characters
[0-9A-Fa-f]. They get attributed to the boot image entry in the
catalog.
*next* ends the definition of a boot image and starts a new one.
Any following -bootimage bootspecs will affect the new image. The
first "next" discards eventually loaded boot images and their
catalog.
*discard* gives up an existing boot catalog and its boot images.
*keep* keeps or copies boot images unaltered and writes a new
catalog.
*patch* applies patching to existing boot images if they seem to
bear a boot info table.
*system_area=*disk_path copies at most 32768 bytes from the given
"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.
-boot_image isolinux system_area= implies "partition_table=on".
*partition_table=on* causes a simple partition table to be written
"partition_table=on" causes a simple partition table to be written
into bytes 446 to 511 of the System Area.
With type "isolinux" it shows a partition that begins at byte 0
and it causes the LBA of the first boot image to be written into
the MBR. For the first session this works only if also
"system_area=" and "bin_path=" or "dir=" is given.
and it causes the boot image LBA to be written into the MBR. For
the first session this works only if also "system_area=" and
"bin_path=" or "dir=" is given.
With types "any" and "grub" it shows a single partiton which
starts at byte 512 and ends where the ISO image ends. This works
with or without system_area= or boot image.
@ -2848,9 +2823,7 @@ programs trigger comparable actions.
-find -exec sort_weight).
Adopted from grub-mkisofs are --protective-msdos-label (see
-boot_image grub partition_table=on) and
--modification-date=YYYYMMDDhhmmsscc (see -volume_date uuid). For
EFI bootable GRUB boot images use -efi-boot. It performs
-boot_image grub efi_path= surrounded by two -boot_image any next.
--modification-date=YYYYMMDDhhmmsscc (see -volume_date uuid).
For MBR bootable ISOLINUX images there is -isohybrid-mbr FILE,
where FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use
this instead of -G to apply the effect of -boot_image isolinux
@ -3753,7 +3726,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -out_charset sets output character set: SetWrite. (line 119)
* -outdev aquires a drive for output: AqDrive. (line 29)
* -overwrite enables overwriting in ISO: SetInsert. (line 127)
* -pacifier controls pacifier text form: Emulation. (line 105)
* -pacifier controls pacifier text form: Emulation. (line 103)
* -padding sets amount of image padding: SetWrite. (line 202)
* -page set terminal geometry: DialogCtl. (line 15)
* -paste_in copies file into disk file: Restore. (line 117)
@ -3780,7 +3753,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -rollback discards pending changes: Writing. (line 9)
* -rollback_end ends program without writing: Scripting. (line 125)
* -rom_toc_scan searches for sessions: Loading. (line 189)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 115)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 113)
* -scsi_log reports SCSI commands: Scripting. (line 113)
* -session_log logs written sessions: Scripting. (line 104)
* -session_string composes session info line: Inquiry. (line 56)
@ -3836,11 +3809,11 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Backslash Interpretation, _definition: Processing. (line 49)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 168)
* Backup, enable features, -for_backup: Loading. (line 163)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 115)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 113)
* Blank media, _definition: Media. (line 25)
* Blind growing, _definition: Methods. (line 40)
* Bootability, control, -boot_image: Bootable. (line 20)
* cdrecord, Emulation: Emulation. (line 72)
* cdrecord, Emulation: Emulation. (line 70)
* Character Set, _definition: Charset. (line 6)
* Character Set, for input, -in_charset: Loading. (line 73)
* Character Set, for input/output, -charset: Charset. (line 43)
@ -3875,9 +3848,9 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, write and eject, -commit_eject: Writing. (line 40)
* El Torito, _definiton: Extras. (line 19)
* Emulation, -as: Emulation. (line 13)
* Emulation, cdrecord, -as: Emulation. (line 72)
* Emulation, cdrecord, -as: Emulation. (line 70)
* Emulation, mkisofs, -as: Emulation. (line 16)
* Emulation, pacifier form, -pacifier: Emulation. (line 105)
* Emulation, pacifier form, -pacifier: Emulation. (line 103)
* Examples: Examples. (line 6)
* Filter, _definition: Filter. (line 6)
* Filter, apply to file tree, -set_filter_r: Filter. (line 84)
@ -3928,7 +3901,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* iso_rr_path, _definition: Insert. (line 7)
* List delimiter, _definiton: Processing. (line 8)
* MBR, _definiton: Extras. (line 26)
* MBR, set, -boot_image system_area=: Bootable. (line 109)
* MBR, set, -boot_image system_area=: Bootable. (line 85)
* MD5, control handling, -md5: Loading. (line 141)
* Media, erase, -blank: Writing. (line 45)
* Media, format, -format: Writing. (line 69)
@ -3958,7 +3931,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Ownership, global in ISO image, -uid: SetWrite. (line 125)
* Ownership, in ISO image, -chown: Manip. (line 42)
* Ownership, in ISO image, -chown_r: Manip. (line 47)
* Partition table, _definiton: Bootable. (line 116)
* Partition table, _definiton: Bootable. (line 92)
* Pathspec, _definition: SetInsert. (line 120)
* Pattern expansion, _definition: Processing. (line 22)
* Pattern expansion, for disk paths, -disk_pattern: Insert. (line 31)
@ -4009,7 +3982,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Session, mount command line, -mount_cmd: Inquiry. (line 31)
* Session, mount parameters, -mount_opts: Inquiry. (line 47)
* Session, select as input, -load: Loading. (line 11)
* System area, _definiton: Bootable. (line 109)
* System area, _definiton: Bootable. (line 85)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 189)
* Table-of-content, show, -toc: Inquiry. (line 18)
* Timestamps, set in ISO image, -alter_date: Manip. (line 146)
@ -4057,50 +4030,50 @@ Node: Media6089
Node: Methods8519
Node: Drives11066
Node: Extras14332
Node: Processing17730
Node: Dialog21226
Node: Options22883
Node: AqDrive24451
Node: Loading27357
Node: Insert39792
Node: SetInsert48149
Node: Manip56716
Node: CmdFind64592
Node: Filter73937
Node: Writing78286
Node: SetWrite84575
Node: Bootable94707
Node: Charset102455
Node: Exception105209
Node: DialogCtl109724
Node: Inquiry112069
Node: Navigate116209
Node: Verify123563
Node: Restore131983
Node: Emulation138639
Node: Scripting145465
Node: Frontend151027
Node: Examples152228
Node: ExDevices153397
Node: ExCreate153879
Node: ExDialog155153
Node: ExGrowing156415
Node: ExModifying157217
Node: ExBootable157718
Node: ExCharset158265
Node: ExPseudo159093
Node: ExCdrecord159987
Node: ExMkisofs160302
Node: ExGrowisofs161305
Node: ExException162429
Node: ExTime162883
Node: ExIncBackup163342
Node: ExRestore166814
Node: ExRecovery167783
Node: Files168349
Node: Seealso169387
Node: Legal169911
Node: CommandIdx170833
Node: ConceptIdx184134
Node: Processing17736
Node: Dialog21232
Node: Options22889
Node: AqDrive24457
Node: Loading27363
Node: Insert39798
Node: SetInsert48155
Node: Manip56722
Node: CmdFind64598
Node: Filter73845
Node: Writing78194
Node: SetWrite84483
Node: Bootable94615
Node: Charset100726
Node: Exception103480
Node: DialogCtl107995
Node: Inquiry110340
Node: Navigate114480
Node: Verify121834
Node: Restore130254
Node: Emulation136910
Node: Scripting143597
Node: Frontend149159
Node: Examples150360
Node: ExDevices151529
Node: ExCreate152011
Node: ExDialog153285
Node: ExGrowing154547
Node: ExModifying155349
Node: ExBootable155850
Node: ExCharset156397
Node: ExPseudo157225
Node: ExCdrecord158119
Node: ExMkisofs158434
Node: ExGrowisofs159437
Node: ExException160561
Node: ExTime161015
Node: ExIncBackup161474
Node: ExRestore164946
Node: ExRecovery165915
Node: Files166481
Node: Seealso167519
Node: Legal168043
Node: CommandIdx168965
Node: ConceptIdx182266

End Tag Table

View File

@ -44,7 +44,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Apr 28, 2010"
@c man .TH XORRISO 1 "Apr 18, 2010"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -496,8 +496,8 @@ characters. Rock Ridge fulfills this demand.
@sp 1
@cindex El Torito, _definiton
An @strong{El Torito}
boot record connects one or more boot images, which are binary program files
stored in the ISO image, with the bootstrapping facility of
boot record connects a boot image, which is a binary 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.
@*
@ -2004,9 +2004,8 @@ attributes a LBA weight number to regular files.
@*
The number may range from -2147483648 to 2147483647. The higher it is, the
lower will be the block address of the file data in the emerging ISO image.
Currently the boot catalog has a hardcoded weight of 1 billion.
Normally it should occupy the block with the lowest possible address.
Data files get added or loaded with initial weight 0.
(Currently the boot catalog has a hardcoded weight of 1000. Better keep
own weights lower than that.)
@*
E.g.: -exec sort_weight 3 @minus{}@minus{}
@*
@ -2588,7 +2587,7 @@ For images which will never get to a CD it is safe to use -padding 0 .
@section El Torito bootable ISO images
@c man .PP
Contrary to published specifications many BIOSes will load an El Torito
record from the first session on media and not from the last one, which
object from the first session on media and not from the last one, which
gets mounted by default. This makes no problems with overwriteable media,
because they appear to inadverted readers as one single session.
@*
@ -2610,54 +2609,48 @@ can assume overwriteable media.
@cindex Write, bootability, -boot_image
@cindex Bootability, control, -boot_image
@*
"discard"|"keep"|"patch"|"show_status"|bootspec|"next"
"discard"|"keep"|"patch"|"show_status"|bootspec
@*
@sp 1
Define the handling of an eventual set of El Torito boot images which
has been read from an existing ISO image or define how to make a prepared
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 of one or more boot
images. Sequence matters.
-boot_image command may be used to define the handling. Sequence matters.
@*
Types @strong{isolinux} and @strong{grub} care for known peculiarities.
Type @strong{any} makes
no assumptions about the origin of the boot images.
Types "isolinux" and "grub" care for known peculiarities. Type "any" makes
no assumptions about the origin of the boot image.
@*
@sp 1
El Torito boot images of any type can be newly inserted, or discarded,
or patched, or kept unaltered.
Whether to patch or to keep depends on whether
the boot images contain boot info tables.
The latter is only safe if the format of the boot image is
relocatable without content changes.
@*
A boot info table 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"
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".
@*
If patching is enabled, then boot images from previous sessions will
be checked whether they seem to bear a boot info table. If not,
then they stay unpatched. This check is not infallible. So if
you do know that the images need no patching, use "any" "keep".
"grub" "patch" will not patch EFI images (platform_id=0xef).
"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 input media.
@*
Most safe is the default: -boot_image "any" "discard".
@*
Advised for GRUB : -boot_image "grub" "patch"
@*
For ISOLINUX : -boot_image "isolinux" "patch"
@*
@strong{show_status} will print what is known about the loaded boot images
and their designated fate.
@*
@sp 1
A @strong{bootspec} is a word of the form name=value and is used to describe
the parameters of a boot image by an El Torito record and eventually a MBR.
The names "dir", "bin_path", "efi_path" lead to El Torito bootable images.
Name "system_area" activates a given file as MBR.
A bootspec is a word of the form name=value and is used to 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
@ -2681,56 +2674,31 @@ which bundles these individual settings:
@*
-boot_image any boot_info_table=on
@*
@strong{bin_path=} depicts the boot image file, a binary program which is to be
started by the hardware boot facility (e.g. the BIOS) at boot time.
@*
@strong{efi_path=} depicts a boot image file that is ready for EFI booting.
Its load_size is determined automatically, no boot info table gets
written, platform_id is 0xef.
"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
@strong{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.
The catalog lists the boot images and is read by the boot facility to choose
one of the boot images.
@*
@strong{load_size=} is a value which depends on the boot image.
Default 2048 should be overridden only if a better value is known.
"load_size=" is a value which depends on the boot image. Default 2048 should
be overridden only if a better value is known.
@*
@strong{boot_info_table=on} may be used to apply patching to a boot image which
"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.
@*
@strong{platform_id=} defines by two hex digits the Platform ID of the
boot image. "00" is 80x86 PC-BIOS, "01" is PowerPC, "02" is Mac, "ef" is EFI.
"discard" gives up an existing boot image.
@*
@strong{id_string=}text|56_hexdigits defines the ID string of the boot catalog
section where the boot image will be listed. If the value consists of 56
characters [0-9A-Fa-f] then it is converted into 28 bytes, else the first
28 characters become the ID string.
The ID string of the first boot image becomes the overall catalog ID.
It is limited to 24 characters. Other id_strings become section IDs.
"keep" keeps or copies an existing boot image unaltered.
@*
@strong{sel_crit=}hexdigits defines the Selection Criteria of the boot image.
Up to 20 bytes get read from the given characters [0-9A-Fa-f].
They get attributed to the boot image entry in the catalog.
@*
@strong{next} ends the definition of a boot image and starts a new one.
Any following -bootimage bootspecs will affect the new image.
The first "next" discards eventually loaded boot images and their
catalog.
@*
@strong{discard} gives up an existing boot catalog and its boot images.
@*
@strong{keep} keeps or copies boot images unaltered and writes a new catalog.
@*
@strong{patch} applies patching to existing boot images
if they seem to bear a boot info table.
"patch" applies boot info table patching if an existing boot image gets copied
to a new location.
@*
@cindex System area, _definiton
@cindex MBR, set, -boot_image system_area=
@strong{system_area=}disk_path copies at most 32768 bytes from the given
disk file to the very start of the ISO image.
"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.
@*
@ -2740,13 +2708,12 @@ to the ISO image.
-boot_image isolinux system_area= implies "partition_table=on".
@*
@cindex Partition table, _definiton
@strong{partition_table=on} causes a simple partition table to be written
into bytes 446 to 511 of the System Area.
"partition_table=on" causes a simple partition table to be written into bytes
446 to 511 of the System Area.
@*
With type "isolinux" it shows a partition that begins at byte 0 and it causes
the LBA of the first boot image to be written into the MBR. For the first
session this works only if also "system_area=" and "bin_path=" or "dir="
is given.
the boot image LBA to be written into the MBR. For the first session this
works only if also "system_area=" and "bin_path=" or "dir=" is given.
@*
With types "any" and "grub" it shows a single
partiton which starts at byte 512 and ends where the ISO image ends.
@ -3805,8 +3772,7 @@ of all regular files underneath directory iso_rr_path.
Adopted from grub-mkisofs are @minus{}@minus{}protective-msdos-label
(see -boot_image grub partition_table=on) and
@minus{}@minus{}modification-date=YYYYMMDDhhmmsscc
(see -volume_date uuid). For EFI bootable GRUB boot images use --efi-boot.
It performs -boot_image grub efi_path= surrounded by two -boot_image any next.
(see -volume_date uuid).
@*
For MBR bootable ISOLINUX images there is -isohybrid-mbr FILE, where
FILE is one of the Syslinux files mbr/isohdp[fp]x*.bin . Use this

View File

@ -123,7 +123,7 @@ Writes result as completely new image or as add-on session
to optical media or filesystem objects.
</LI>
<LI>
Can activate ISOLINUX and GRUB boot images by El Torito boot record and MBR.
Can activate ISOLINUX and GRUB boot images by El Torito boot record.
</LI>
<LI>
Can perform multi-session tasks as emulation of mkisofs and cdrecord.
@ -436,19 +436,19 @@ files or trees to disk:
<P>
<DL>
<DT><H3>Download as source code (see README):</H3></DT>
<DD><A HREF="xorriso-0.5.6.tar.gz">xorriso-0.5.6.tar.gz</A>
(1600 KB).
<DD><A HREF="xorriso-0.5.4.tar.gz">xorriso-0.5.4.tar.gz</A>
(1580 KB).
</DD>
<DD>(Released 19 Apr 2010)</DD>
<DD><A HREF="xorriso-0.5.6.tar.gz.sig">xorriso-0.5.6.tar.gz.sig</A></DD>
<DD>(Released 18 Apr 2010)</DD>
<DD><A HREF="xorriso-0.5.4.tar.gz.sig">xorriso-0.5.4.tar.gz.sig</A></DD>
<DD>
(detached GPG signature for verification by
<KBD>gpg --verify xorriso-0.5.6.tar.gz.sig xorriso-0.5.6.tar.gz</KBD>).
<KBD>gpg --verify xorriso-0.5.4.tar.gz.sig xorriso-0.5.4.tar.gz</KBD>).
</DD>
<DD>
Also on <A HREF="http://www.gnu.org/prep/ftp.html">
mirrors of ftp://ftp.gnu.org/gnu/ </A>
as xorriso/xorriso-0.5.6.tar.gz
as xorriso/xorriso-0.5.4.tar.gz
</DD>
</DL>
</DD>
@ -476,7 +476,7 @@ as xorriso/xorriso-0.5.6.tar.gz
<HR>
<P>
Bug fixes towards xorriso-0.5.4:
Bug fixes towards xorriso-0.5.2:
<UL>
<LI>- none -</LI>
<!--
@ -496,16 +496,25 @@ Bug fixes in .pl01 towards xorriso-:
-->
<P>
Enhancements towards previous stable version xorriso-0.5.4:
Enhancements towards previous stable version xorriso-0.5.2.pl00:
<UL>
<LI>
Allowing up to 32 boot images
New -as mkisofs options -G and --protective-msdos-label for grub-mkrescue
</LI>
<LI>
New -boot_image bootspecs efi_path=, platform_id=, sel_crit=, id_string=, next
New option -volume_date, for grub-mkrescue: -as mkisofs --modification-date=
</LI>
<LI>
New -as mkisofs options --efi-boot, -eltorito-alt-boot
New: -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr
</LI>
<LI>
New find action mkisofs_r and emulation -as mkisofs -r
</LI>
<LI>
New -find action sort_weight, new -as mkisofs --sort-weight
</LI>
<LI>
New -compliance options only_iso_version, no_j_force_dots
</LI>
<!--
<LI>- none -</LI>
@ -534,11 +543,11 @@ libburnia project and the legal intentions of
<DD>(founded by Derek Foreman and Ben Jansens,
developed and maintained since August 2006 by
Thomas Schmitt from team of libburnia-project.org)</DD>
<DT>libisofs-0.6.33</DT>
<DT>libisofs-0.6.31</DT>
<DD>operates on ISO 9660 filesystem images.</DD>
<DD>(By Vreixo Formoso, Mario Danic and Thomas Schmitt
from team of libburnia-project.org)</DD>
<DT>libisoburn-0.5.6</DT>
<DT>libisoburn-0.5.4</DT>
<DD>coordinates libburn and libisofs, emulates multi-session where needed,
and hosts the original source code of program xorriso.</DD>
<DD>(By Vreixo Formoso and Thomas Schmitt
@ -553,8 +562,8 @@ cdrecord and mkisofs.</DT>
<P>
<DL>
<DT><H3>Development snapshot, version 0.5.7 :</H3></DT>
<DD>Bug fixes towards xorriso-0.5.6:
<DT><H3>Development snapshot, version 0.5.5 :</H3></DT>
<DD>Bug fixes towards xorriso-0.5.4:
<UL>
<LI>- none yet -</LI>
<!--
@ -562,7 +571,7 @@ cdrecord and mkisofs.</DT>
-->
</UL>
</DD>
<DD>Enhancements towards stable version 0.5.6:
<DD>Enhancements towards stable version 0.5.4:
<UL>
<LI>- none yet -</LI>
<!--
@ -571,9 +580,9 @@ cdrecord and mkisofs.</DT>
</UL>
</DD>
<DD>&nbsp;</DD>
<DD><A HREF="README_xorriso_devel">README 0.5.7</A>
<DD><A HREF="xorriso_help_devel">xorriso_0.5.7 -help</A></DD>
<DD><A HREF="man_1_xorriso_devel.html">man xorriso (as of 0.5.7)</A></DD>
<DD><A HREF="README_xorriso_devel">README 0.5.5</A>
<DD><A HREF="xorriso_help_devel">xorriso_0.5.5 -help</A></DD>
<DD><A HREF="man_1_xorriso_devel.html">man xorriso (as of 0.5.5)</A></DD>
<DD>&nbsp;</DD>
<DT>If you want to distribute development versions of xorriso, then use
this tarball which produces static linking between xorriso and the
@ -583,8 +592,8 @@ libburnia libraries.
installation see README)
</DD>
<DD>
<A HREF="xorriso-0.5.7.tar.gz">xorriso-0.5.7.tar.gz</A>
(1600 KB).
<A HREF="xorriso-0.5.5.tar.gz">xorriso-0.5.5.tar.gz</A>
(1580 KB).
</DD>
<DT>A dynamically linked development version of xorriso can be obtained
from repositories of

View File

@ -18,11 +18,6 @@
#ifndef Xorriso_private_includeD
#define Xorriso_private_includeD yes
/* >>> transition to new boot image management */
#define Xorriso_multi_booT 1
/** The source code release timestamp */
#include "xorriso_timestamp.h"
#ifndef Xorriso_timestamP
@ -264,32 +259,16 @@ struct XorrisO { /* the global context of xorriso */
int stdio_sync; /* stdio fsync interval: -1, 0, >=32 */
int keep_boot_image;
char boot_image_cat_path[SfileadrL];
int boot_count; /* number of already attached boot images */
int patch_isolinux_image;
char boot_image_bin_path[SfileadrL];
char boot_image_bin_form[16];
int boot_platform_id;
int patch_isolinux_image; /* bit0= boot-info-table , bit1= not with EFI */
int boot_image_emul; /* 0=no emulation
(1=emulation as hard disk)
(2=emulation as floppy)
*/
char boot_image_cat_path[SfileadrL];
off_t boot_image_load_size;
unsigned char boot_id_string[29];
unsigned char boot_selection_crit[21];
int boot_image_isohybrid; /* 0=off , deprecated: 1=auto , 2=on , 3=force */
int boot_efi_default; /* 0= no effect ,
1= appy --efi-boot parameters when attaching to img */
#ifndef Xorriso_multi_booT
/* <<< BOOT replace by attaching previous boot image to IsoImage by
-boot_image any next */
char boot_image_efi_path[SfileadrL];
#endif /* ! Xorriso_multi_booT */
int boot_image_isohybrid; /* 0=off , 1=auto , 2=on , 3=force */
char system_area_disk_path[SfileadrL];
int system_area_options; /* bit0= "GRUB protective msdos label"
(a simple partition table)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2010.05.04.100001"
#define Xorriso_timestamP "2010.04.19.080001"

View File

@ -1309,7 +1309,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, int flag)
if(has_what & isoburn_ropt_has_el_torito) {
if(xorriso->boot_image_bin_path[0])
boot_fate= "replaced by new boot image";
else if(xorriso->patch_isolinux_image & 1)
else if(xorriso->patch_isolinux_image)
boot_fate= "patched at boot info table";
else if(xorriso->keep_boot_image)
boot_fate= "kept unchanged";
@ -1422,7 +1422,6 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
xorriso->no_volset_present= 0;
xorriso->loaded_boot_bin_lba= 0;
xorriso->loaded_boot_cat_path[0]= 0;
xorriso->boot_count= 0;
in_is_out_too= 0;
}
if((flag&2) && xorriso->out_drive_handle!=NULL) {
@ -1608,85 +1607,49 @@ int Xorriso_is_isohybrid(struct XorrisO *xorriso, IsoFile *bootimg_node,
}
/* @param flag bit0= operating on newly attached boot image
*/
int Xorriso_set_isolinux_options(struct XorrisO *xorriso,
IsoImage *image, int flag)
{
int make_isohybrid_mbr= 0, ret, patch_table= 0, num_boots, i;
ElToritoBootImage *bootimg, **boots = NULL;
IsoFile *bootimg_node, **bootnodes = NULL;
int make_isohybrid_mbr= 0, ret, patch_table= 0;
ElToritoBootImage *bootimg;
IsoFile *bootimg_node;
ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, NULL);
Xorriso_process_msg_queues(xorriso,0);
if(ret != 1) {
sprintf(xorriso->info_text, "Programming error: No boot image available in Xorriso_set_isolinux_options()");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FATAL", 0);
ret= -1; goto ex;
return(-1);
}
ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0);
Xorriso_process_msg_queues(xorriso,0);
if(ret != 1) {
Xorriso_report_iso_error(xorriso, "", ret, "Cannot inquire boot images", 0,
"FATAL", 1);
ret= -1; goto ex;
patch_table = !!xorriso->patch_isolinux_image;
if(xorriso->boot_image_isohybrid == 0) {
ret= el_torito_set_isolinux_options(bootimg, patch_table, 0);
return(ret == 1);
}
patch_table= xorriso->patch_isolinux_image & 1;
if((flag & 1) && num_boots > 1) {
ret= el_torito_set_isolinux_options(boots[num_boots - 1], patch_table, 0);
ret= (ret == 1); goto ex;
}
/* Handle patching of first attached boot image or of imported boot images
*/
for(i= 0; i < num_boots; i++) {
patch_table = xorriso->patch_isolinux_image & 1;
if(patch_table && !(flag & 1)) {
if(!el_torito_seems_boot_info_table(boots[i], 0))
patch_table= 0;
else if((xorriso->patch_isolinux_image & 2) &&
el_torito_get_boot_platform_id(boots[i]) == 0xef)
patch_table= 0;
}
if(i > 0 || xorriso->boot_image_isohybrid == 0) {
ret= el_torito_set_isolinux_options(boots[i], patch_table, 0);
if(ret != 1)
{ret= 0; goto ex;}
continue;
}
if(xorriso->boot_image_isohybrid == 3) {
if(xorriso->boot_image_isohybrid == 3) {
make_isohybrid_mbr= 1;
} else {
ret= Xorriso_is_isohybrid(xorriso, bootimg_node, 0);
if(ret < 0)
return(0);
if(ret > 0)
make_isohybrid_mbr= 1;
} else {
ret= Xorriso_is_isohybrid(xorriso, bootimg_node, 0);
if(ret < 0)
{ret= 0; goto ex;}
if(ret > 0)
make_isohybrid_mbr= 1;
}
if(xorriso->boot_image_isohybrid == 2 && !make_isohybrid_mbr) {
sprintf(xorriso->info_text,
"Isohybrid signature is demanded but not found in boot image file.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(make_isohybrid_mbr) {
sprintf(xorriso->info_text, "Will write isohybrid MBR.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
xorriso->alignment= 512;
}
ret= el_torito_set_isolinux_options(bootimg,
patch_table | (make_isohybrid_mbr << 1),0);
if(ret != 1)
{ret= 0; goto ex;}
}
ex:
Xorriso_process_msg_queues(xorriso,0);
if(boots != NULL)
free(boots);
if(bootnodes != NULL)
free(bootnodes);
return(ret);
if(xorriso->boot_image_isohybrid == 2 && !make_isohybrid_mbr) {
sprintf(xorriso->info_text,
"Isohybrid signature is demanded but not found in boot image file.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
if(make_isohybrid_mbr) {
sprintf(xorriso->info_text, "Will write isohybrid MBR.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
xorriso->alignment= 512;
}
ret= el_torito_set_isolinux_options(bootimg,
patch_table | (make_isohybrid_mbr << 1),0);
return(ret == 1);
}
@ -1843,432 +1806,14 @@ ex:;
}
/*
bit0= do only report non-default settings
bit1= do only report to fp
bit2= is_default
bit3= append -boot_image any next
bit4= eventually concentrate boot options
*/
int Xorriso_boot_item_status(struct XorrisO *xorriso, char *cat_path,
char *bin_path, int platform_id,
int patch_isolinux, int emul, off_t load_size,
unsigned char *id_string,
unsigned char *selection_crit, char *form,
char *filter, FILE *fp, int flag)
{
int is_default, no_defaults, i, is_default_id= 0, ret;
char *line, bspec[SfileadrL + 80], zeros[28];
off_t file_size;
struct stat stbuf;
no_defaults= flag & 1;
line= xorriso->result_line;
if(flag & 16) {
/* Allow to concentrate boot options. */
memset(zeros, 0, 28);
if(memcmp(id_string, zeros, 28) == 0 &&
memcmp(selection_crit, zeros, 20) == 0)
is_default_id= 1;
/* -boot_image isolinux dir= ... */
bspec[0]= 0;
if(strcmp(form, "isolinux") != 0 && strcmp(form, "any") != 0)
;
else if(strcmp(bin_path, "/isolinux.bin") == 0 &&
strcmp(cat_path, "/boot.cat") == 0)
strcpy(bspec, "dir=/");
else if(strcmp(bin_path, "/isolinux/isolinux.bin") == 0 &&
strcmp(cat_path, "/isolinux/boot.cat") == 0)
strcpy(bspec, "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(bspec, "dir=/boot/isolinux");
memset(zeros, 0, 28);
if(bspec[0] && platform_id == 0 && patch_isolinux &&
load_size == 2048 && is_default_id) {
sprintf(line, "-boot_image isolinux %s\n", bspec);
Xorriso_status_result(xorriso,filter,fp,flag&2);
return(1);
}
file_size= 0;
ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4);
if(ret == 0)
file_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512)) * 512;
if(platform_id == 0xef && !patch_isolinux &&
load_size == file_size && is_default_id) {
sprintf(line, "-boot_image any efi_path=");
Text_shellsafe(bin_path, line, 1);
strcat(line, "\n");
Xorriso_status_result(xorriso,filter,fp,flag&2);
return(1);
}
}
is_default= (bin_path[0] == 0) || (flag & 4);
sprintf(line, "-boot_image %s bin_path=", form);
Text_shellsafe(bin_path, line, 1);
strcat(line, "\n");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (platform_id == 0 || (flag & 4));
sprintf(line, "-boot_image %s platform_id=0x%-2.2x\n", form, platform_id);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((patch_isolinux & 1) == 0 || bin_path[0] == 0 || (flag & 4));
sprintf(line, "-boot_image %s boot_info_table=%s\n",
(patch_isolinux & 2) ? "grub" : form, patch_isolinux ? "on" : "off");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (load_size == 2048 || (flag & 4));
sprintf(line, "-boot_image %s load_size=%lu\n",
form, (unsigned long) load_size);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= 1;
if(!(flag & 4))
for(i= 0; i < 20; i++)
if(selection_crit[i])
is_default= 0;
sprintf(line, "-boot_image %s sel_crit=", form);
for(i= 0; i < 20; i++)
sprintf(line + strlen(line), "%-2.2X", (unsigned int) selection_crit[i]);
strcat(line, "\n");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= 1;
if(!(flag & 4))
for(i= 0; i < 28; i++)
if(id_string[i])
is_default= 0;
sprintf(line, "-boot_image %s id_string=", form);
for(i= 0; i < 28; i++)
sprintf(line + strlen(line), "%-2.2X", (unsigned int) id_string[i]);
strcat(line, "\n");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
return(1);
}
/*
bit0= do only report non-default settings
bit1= do only report to fp
*/
int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
int flag)
{
int ret, i, num_boots, hflag;
int bin_path_in_use= 0, is_default, no_defaults;
char sfe[5*SfileadrL], path[SfileadrL], *form= "any", *line;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
IsoImage *image= NULL;
ElToritoBootImage **boots = NULL;
IsoFile **bootnodes = NULL;
int platform_id, patch, load_size;
enum eltorito_boot_media_type media_type;
unsigned char id_string[29], sel_crit[21];
line= xorriso->result_line;
no_defaults= flag & 1;
if(xorriso->boot_count == 0 && xorriso->boot_image_bin_path[0] == 0) {
if(xorriso->patch_isolinux_image & 1) {
sprintf(line, "-boot_image %s patch\n",
xorriso->patch_isolinux_image & 2 ? "grub" : form);
is_default= 0;
} else if(xorriso->keep_boot_image) {
sprintf(line, "-boot_image %s keep\n", form);
is_default= 0;
} else {
sprintf(line, "-boot_image %s discard\n", form);
is_default= 1;
}
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
ret= 1; goto ex;
}
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print boot info", 16);
if(ret<=0)
{ret= 0; goto ex;}
image= isoburn_get_attached_image(drive);
Xorriso_process_msg_queues(xorriso,0);
if(image == NULL)
{ret= 0; goto ex;}
if(xorriso->boot_image_bin_path[0] || xorriso->boot_count > 0)
bin_path_in_use= 1;
if(xorriso->boot_image_cat_path[0] && bin_path_in_use) {
is_default= 0;
sprintf(line,"-boot_image %s cat_path=%s\n",
form, Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
}
if(xorriso->boot_count > 0) {
/* show attached boot image info */;
ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0);
Xorriso_process_msg_queues(xorriso,0);
if(ret == 1 && num_boots > 0) {
for(i= 0; i < num_boots; i++) {
ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootnodes[i], path, 0);
if(ret <= 0)
continue;
platform_id= el_torito_get_boot_platform_id(boots[i]);
patch= el_torito_get_isolinux_options(boots[i], 0);
el_torito_get_boot_media_type(boots[i], &media_type);
load_size= el_torito_get_load_size(boots[i]) * 512;
el_torito_get_id_string(boots[i], id_string);
el_torito_get_selection_crit(boots[i], sel_crit);
ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path,
path, platform_id, patch & 1, media_type,
load_size, id_string, sel_crit, "any",
filter, fp, 16 | (flag & 3));
if(ret <= 0)
continue;
sprintf(line,"-boot_image %s next\n", form);
Xorriso_status_result(xorriso,filter,fp,flag&2);
}
}
}
/* Show pending boot image info */
if(strcmp(xorriso->boot_image_bin_form, "isolinux") == 0 ||
strcmp(xorriso->boot_image_bin_form, "grub") == 0)
form= xorriso->boot_image_bin_form;
if(xorriso->boot_count > 0 &&
xorriso->boot_platform_id == 0 &&
xorriso->patch_isolinux_image == 0 &&
xorriso->boot_image_bin_path[0] == 0 &&
xorriso->boot_image_emul == 0 &&
xorriso->boot_image_load_size == 4 * 512) {
for(i= 0; i < 20; i++)
if(xorriso->boot_selection_crit[i])
break;
if(i >= 20)
for(i= 0; i < 28; i++)
if(xorriso->boot_id_string[i])
break;
if(i >= 28)
{ret= 1; goto ex;} /* Images registered, pending is still default */
}
hflag= 16;
if(xorriso->boot_platform_id == 0xef && !xorriso->boot_efi_default)
hflag= 0;
ret= Xorriso_boot_item_status(xorriso, xorriso->boot_image_cat_path,
xorriso->boot_image_bin_path, xorriso->boot_platform_id,
xorriso->patch_isolinux_image, xorriso->boot_image_emul,
xorriso->boot_image_load_size, xorriso->boot_id_string,
xorriso->boot_selection_crit, form,
filter, fp, hflag | (flag & 3));
if(ret <= 0)
goto ex;
ret= 1;
ex:
if(boots != NULL)
free(boots);
if(bootnodes != NULL)
free(bootnodes);
return(ret);
}
/* @param flag bit0= do not increment boot_count
and do not reset boot parameters
bit1= dispose attached boot images
*/
int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag)
{
int ret;
char sfe[5*SfileadrL], *cpt;
struct burn_drive_info *source_dinfo;
struct burn_drive *source_drive;
IsoImage *image= NULL;
IsoNode *node;
ElToritoBootImage *bootimg;
enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL;
char *bin_path;
int emul, platform_id;
off_t load_size;
struct stat stbuf;
int hflag= 0;
if(xorriso->boot_image_bin_path[0] == 0 && !(flag & 2)) {
/* >>> no boot image path given : no op */;
ret= 2; goto ex;
}
if(xorriso->in_drive_handle == NULL)
hflag= 2;
ret= Xorriso_get_drive_handles(xorriso, &source_dinfo, &source_drive,
"on attempt to attach boot image", hflag);
if(ret<=0)
goto ex;
image= isoburn_get_attached_image(source_drive);
if(image == NULL) {
/* (should not happen) */
sprintf(xorriso->info_text,
"No ISO image present on attempt to attach boot image");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
if(flag & 2) {
iso_image_remove_boot_image(image);
xorriso->boot_count= 0;
ret= 1; goto ex;
}
bin_path= xorriso->boot_image_bin_path;
emul= xorriso->boot_image_emul;
platform_id= xorriso->boot_platform_id;
load_size= xorriso->boot_image_load_size;
if(xorriso->boot_efi_default) {
emul= 0;
platform_id= 0xef;
xorriso->patch_isolinux_image= 0;
}
if(platform_id == 0xef || load_size < 0) {
ret= Xorriso_iso_lstat(xorriso, bin_path, &stbuf, 2 | 4);
if(ret != 0)
{ret= 0; goto ex;}
load_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512)) * 512;
}
sprintf(xorriso->info_text, "Adding boot image %s",
Text_shellsafe(bin_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
if(emul == 0)
emul_type= ELTORITO_NO_EMUL;
else if(emul == 1)
emul_type= ELTORITO_HARD_DISC_EMUL;
else if(emul == 2)
emul_type= ELTORITO_FLOPPY_EMUL;
ret= Xorriso_node_from_path(xorriso, image, bin_path, &node, 1);
if(ret <= 0) {
sprintf(xorriso->info_text,
"Cannot find in ISO image: -boot_image ... bin_path=%s",
Text_shellsafe(bin_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(xorriso->boot_count == 0) {
if(xorriso->boot_image_cat_path[0] == 0) {
strcpy(xorriso->boot_image_cat_path, bin_path);
cpt= strrchr(xorriso->boot_image_cat_path, '/');
if(cpt == NULL)
cpt= xorriso->boot_image_cat_path;
else
cpt++;
strcpy(cpt, "boot.cat");
}
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;}
}
}
/* Discard old boot image, set new one */
ret= iso_image_get_boot_image(image, &bootimg, NULL, NULL);
if(ret == 1)
iso_image_remove_boot_image(image);
ret= iso_image_set_boot_image(image, bin_path, emul_type,
xorriso->boot_image_cat_path, &bootimg);
if(ret > 0)
iso_image_set_boot_catalog_weight(image, 1000000000);
} else {
ret= iso_image_add_boot_image(image, bin_path, emul_type, 0, &bootimg);
}
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when attaching El-Torito boot image to ISO 9660 image",
0, "FAILURE", 1);
sprintf(xorriso->info_text,
"Could not attach El-Torito boot image to ISO 9660 image");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
el_torito_set_boot_platform_id(bootimg, (uint8_t) platform_id);
el_torito_set_load_size(bootimg, load_size / 512);
el_torito_set_id_string(bootimg, xorriso->boot_id_string);
el_torito_set_selection_crit(bootimg, xorriso->boot_selection_crit);
ret= Xorriso_set_isolinux_options(xorriso, image, 1);
if(!(flag & 1)) {
/* Register attachment and reset even in case of error return */
xorriso->boot_count++;
xorriso->boot_platform_id= 0;
xorriso->patch_isolinux_image= 0;
xorriso->boot_image_bin_path[0]= 0;
xorriso->boot_image_bin_form[0]= 0;
xorriso->boot_image_emul= 0;
xorriso->boot_image_load_size= 4 * 512;
memset(xorriso->boot_id_string, 0, sizeof(xorriso->boot_id_string));
memset(xorriso->boot_selection_crit, 0,
sizeof(xorriso->boot_selection_crit));
xorriso->boot_efi_default= 0;
}
if(ret <= 0)
goto ex;
ret= 1;
ex:;
if(image != NULL)
iso_image_unref(image);
return(ret);
}
/* #define Xorriso_boot_dummY 1 */
/* @param flag bit0= do not write but only prepare and return size in sectors
*/
int Xorriso_write_session(struct XorrisO *xorriso, int flag)
{
int ret, relax= 0, i, pacifier_speed= 0, data_lba, ext, is_bootable= 0;
int ret, relax= 0, i, pacifier_speed= 0, data_lba, ext;
int major, minor, micro;
char xorriso_id[256], *img_id, sfe[5*SfileadrL], *out_cs;
char xorriso_id[256], *img_id, sfe[5*SfileadrL], *cpt, *out_cs;
struct isoburn_imgen_opts *sopts= NULL;
struct burn_drive_info *dinfo, *source_dinfo;
struct burn_drive *drive, *source_drive;
@ -2280,24 +1825,12 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
struct burn_track **tracks;
enum burn_disc_status s;
IsoImage *image= NULL;
IsoNode *root_node;
IsoNode *node, *root_node;
ElToritoBootImage *bootimg;
enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL;
int profile_number;
char profile_name[80];
#ifdef Xorriso_multi_booT
IsoBoot *bootcat_node;
#else
char *cpt;
IsoNode *node;
ElToritoBootImage *bootimg;
ElToritoBootImage *efi_bootimg;
enum eltorito_boot_media_type emul_type= ELTORITO_NO_EMUL;
int boot_image_emul, boot_platform_id;
off_t boot_image_load_size;
struct stat stbuf;
char *boot_image_bin_path;
#endif /* ! Xorriso_multi_booT */
ret= Xorriso_finish_hl_update(xorriso, 0);
if(ret <= 0)
return(ret);
@ -2348,7 +1881,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
ret= isoburn_igopt_new(&sopts, 0);
if(ret<=0) {
Xorriso_process_msg_queues(xorriso, 0);
goto ex;
return(ret);
}
relax= xorriso->relax_compliance;
@ -2377,67 +1910,21 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
goto ex;
/* Activate, adjust or discard boot image */
#ifdef Xorriso_multi_booT
if(image!=NULL && !(flag&1)) {
is_bootable= iso_image_get_boot_image(image, NULL, NULL, &bootcat_node);
if(xorriso->boot_image_bin_path[0]) {
ret= Xorriso_attach_boot_image(xorriso, xorriso->boot_count == 0);
if(ret <= 0)
goto ex;
}
if(xorriso->boot_count > 0) {
/* Eventually rename boot catalog node to changed boot_image_cat_path */
if(is_bootable > 0) {
ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootcat_node, sfe, 0);
if(ret > 0) {
if(strcmp(sfe, xorriso->boot_image_cat_path) != 0) {
ret= Xorriso_rename(xorriso, NULL, sfe,
xorriso->boot_image_cat_path, 0);
if(ret <= 0)
goto ex;
}
}
}
#else /* Xorriso_multi_booT */
boot_image_bin_path= xorriso->boot_image_bin_path;
boot_image_emul= xorriso->boot_image_emul;
boot_platform_id= xorriso->boot_platform_id;
boot_image_load_size= xorriso->boot_image_load_size;
/* >>> This is kindof a quick hack.
Needed would be a list of boot images with own parameters each.
*/
if(xorriso->boot_image_efi_path[0]) {
if(xorriso->boot_image_bin_path[0] == 0) {
/* Let EFI boot image be the default image */
boot_image_bin_path= xorriso->boot_image_efi_path;
boot_image_emul= 0;
boot_platform_id= 0xef;
ret= Xorriso_iso_lstat(xorriso, xorriso->boot_image_efi_path,
&stbuf, 2 | 4);
if(ret != 0)
goto ex;
boot_image_load_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512)) * 512;
}
}
/* >>> ??? move down to libisoburn ? */
if(image!=NULL && !(flag&1)) {
is_bootable= iso_image_get_boot_image(image, &bootimg, NULL, NULL);
if(boot_image_bin_path[0]) {
ret= iso_image_get_boot_image(image, &bootimg, NULL, NULL);
/* >>> || xorriso->system_area_disk_path[0] */
if(xorriso->boot_image_bin_path[0]) {
/* discard old boot image, set new one */
if(is_bootable == 1)
if(ret == 1)
iso_image_remove_boot_image(image);
if(boot_image_emul == 1)
if(xorriso->boot_image_emul == 1)
emul_type= ELTORITO_HARD_DISC_EMUL;
else if(boot_image_emul == 2)
else if(xorriso->boot_image_emul == 2)
emul_type= ELTORITO_FLOPPY_EMUL;
if(xorriso->boot_image_cat_path[0] == 0) {
strcpy(xorriso->boot_image_cat_path, boot_image_bin_path);
strcpy(xorriso->boot_image_cat_path, xorriso->boot_image_bin_path);
cpt= strrchr(xorriso->boot_image_cat_path, '/');
if(cpt == NULL)
cpt= xorriso->boot_image_cat_path;
@ -2446,18 +1933,18 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
strcpy(cpt, "boot.cat");
}
sprintf(xorriso->info_text, "Activating boot image %s",
Text_shellsafe(boot_image_bin_path, sfe, 0));
Text_shellsafe(xorriso->boot_image_bin_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
sprintf(xorriso->info_text, "Creating El Torito boot catalog file %s",
Text_shellsafe(xorriso->boot_image_cat_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
ret= Xorriso_node_from_path(xorriso, image, boot_image_bin_path,
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(boot_image_bin_path, sfe, 0));
Text_shellsafe(xorriso->boot_image_bin_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
@ -2482,7 +1969,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
}
}
ret= iso_image_set_boot_image(image, boot_image_bin_path,
ret= iso_image_set_boot_image(image, xorriso->boot_image_bin_path,
emul_type, xorriso->boot_image_cat_path,
&bootimg);
if(ret < 0) {
@ -2495,95 +1982,12 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
#ifdef Xorriso_boot_dummY
/* <<< for testing only */
if(xorriso->boot_image_bin_path[0] == 0)
el_torito_set_id_string(bootimg,
(unsigned char *) "xorriso EFI 3456789012345678");
else
el_torito_set_id_string(bootimg,
(unsigned char *) "xorriso 80x86 BIOS 012345678");
#endif /* Xorriso_boot_dummY */
el_torito_set_boot_platform_id(bootimg, (uint8_t) boot_platform_id);
iso_image_set_boot_catalog_weight(image, 1000000000);
el_torito_set_load_size(bootimg, boot_image_load_size / 512);
el_torito_set_load_size(bootimg, xorriso->boot_image_load_size / 512);
ret= Xorriso_set_isolinux_options(xorriso, image, 0);
if(ret <= 0)
goto ex;
if(boot_image_bin_path == xorriso->boot_image_bin_path &&
xorriso->boot_image_efi_path[0]) {
/* Add EFI image */
sprintf(xorriso->info_text, "Activating additional EFI boot image %s",
Text_shellsafe(xorriso->boot_image_efi_path, sfe, 0));
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
ret= iso_image_add_boot_image(image, xorriso->boot_image_efi_path,
ELTORITO_NO_EMUL, 0, &efi_bootimg);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when adding EFI boot image", 0, "FAILURE", 1);
goto ex;
}
#ifdef Xorriso_boot_dummY
/* <<< for testing only */
el_torito_set_id_string(efi_bootimg,
(unsigned char *) "xorriso EFI 3456789012345678");
el_torito_set_selection_crit(efi_bootimg,
(unsigned char *) "@selection criteria@");
#endif /* Xorriso_boot_dummY */
el_torito_set_boot_platform_id(efi_bootimg, (uint8_t) 0xef);
ret= Xorriso_iso_lstat(xorriso, xorriso->boot_image_efi_path,
&stbuf, 2 | 4);
if(ret != 0)
goto ex;
boot_image_load_size= ((stbuf.st_size / (off_t) 512) +
!!(stbuf.st_size % (off_t) 512));
el_torito_set_load_size(efi_bootimg, boot_image_load_size);
#ifdef Xorriso_boot_dummY
/* <<< for testing only */
ret= iso_image_add_boot_image(image, "/xxx",
ELTORITO_NO_EMUL, 0, &efi_bootimg);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when adding EFI boot image 2", 0, "FAILURE", 1);
goto ex;
}
el_torito_set_id_string(efi_bootimg,
(unsigned char *) "xorriso EFI 3456789012345678");
el_torito_set_selection_crit(efi_bootimg,
(unsigned char *) "@selection crit 2 @");
el_torito_set_boot_platform_id(efi_bootimg, (uint8_t) 0xef);
el_torito_set_load_size(efi_bootimg, boot_image_load_size);
ret= iso_image_add_boot_image(image, "/xxxx",
ELTORITO_NO_EMUL, 0, &efi_bootimg);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso,0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when adding BIOS boot image 2", 0, "FAILURE", 1);
goto ex;
}
el_torito_set_id_string(efi_bootimg,
(unsigned char *) "xorriso BIOS2 abcdefghijklmn");
el_torito_set_selection_crit(efi_bootimg,
(unsigned char *) "@selection crit 3 @");
el_torito_set_boot_platform_id(efi_bootimg, (uint8_t) 0);
el_torito_set_load_size(efi_bootimg, (uint8_t) 4);
#endif /* Xorriso_boot_dummY */
}
#endif /* ! Xorriso_multi_booT */
} else if(xorriso->patch_isolinux_image & 1) {
if(is_bootable == 1) {
} else if(xorriso->patch_isolinux_image) {
if(ret==1) {
relax|= isoburn_igopt_allow_full_ascii;
sprintf(xorriso->info_text, "Patching boot info table");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
@ -2612,11 +2016,11 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
"Could not find any boot image for -boot_image patching");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
}
} else if(xorriso->keep_boot_image && is_bootable == 1) {
} else if(xorriso->keep_boot_image && ret==1) {
relax|= isoburn_igopt_allow_full_ascii;
sprintf(xorriso->info_text, "Keeping boot image unchanged");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
} else if(is_bootable == 1) {
} else if(ret==1) {
iso_image_remove_boot_image(image);
sprintf(xorriso->info_text, "Discarded boot image from old session");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
@ -5898,28 +5302,13 @@ int Xorriso_toc_line(struct XorrisO *xorriso, int flag)
}
int Xorriso__append_boot_params(char *line, ElToritoBootImage *bootimg,
int flag)
{
unsigned int platform_id;
platform_id= el_torito_get_boot_platform_id(bootimg);
if(platform_id != 0)
sprintf(line + strlen(line),
" , platform_id=0x%-2.2X ", (unsigned int) platform_id);
if(el_torito_seems_boot_info_table(bootimg, 0))
sprintf(line + strlen(line), " , boot_info_table=on");
return(1);
}
/* @param flag bit0= no output if no boot record was found
bit1= short form
bit3= report to info channel (else to result channel)
*/
int Xorriso_show_boot_info(struct XorrisO *xorriso, int flag)
{
int ret, bin_path_valid= 0,has_isolinux_mbr= 0, i, num_boots;
int ret, bin_path_valid= 0,has_isolinux_mbr= 0, i;
unsigned int mbr_lba= 0;
off_t lb0_count;
char *respt, sfe[5*SfileadrL], path[SfileadrL];
@ -5927,20 +5316,11 @@ int Xorriso_show_boot_info(struct XorrisO *xorriso, int flag)
struct burn_drive_info *dinfo;
struct burn_drive *drive;
IsoImage *image= NULL;
ElToritoBootImage *bootimg, **boots = NULL;
IsoFile *bootimg_node, **bootnodes = NULL;
ElToritoBootImage *bootimg;
IsoFile *bootimg_node;
IsoBoot *bootcat_node;
respt= xorriso->result_line;
if(xorriso->boot_count > 0) {
if(!(flag & 1)) {
sprintf(respt, "Boot record : overridden by -boot_image any next\n");
Xorriso_toc_line(xorriso, flag & 8);
}
ret= 1; goto ex;
}
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print boot info", 16);
if(ret<=0)
@ -5953,14 +5333,16 @@ no_boot:;
sprintf(respt, "Boot record : none\n");
Xorriso_toc_line(xorriso, flag & 8);
}
goto ex;
return(ret);
}
/* Important: no return before iso_image_unref(image); */
/* Using the nodes with extreme care . They might be deleted meanwhile. */
ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, &bootcat_node);
iso_image_unref(image); /* release obtained reference */
image= NULL;
if(ret != 1)
goto no_boot;
ret= Xorriso_path_from_lba(xorriso, NULL, xorriso->loaded_boot_bin_lba,
path, 1);
if(ret > 0)
@ -6003,49 +5385,22 @@ no_boot:;
strcat(respt, "\n");
Xorriso_toc_line(xorriso, flag & 8);
if(flag & 2)
{ret= 1; goto ex;}
return(1);
if(bin_path_valid)
sprintf(respt, "Boot bin_path: %s\n", Text_shellsafe(path, sfe, 0));
else if(xorriso->loaded_boot_bin_lba <= 0)
sprintf(respt, "Boot bin_path: -not-found-at-load-time-\n");
else
sprintf(respt, "Boot bin_path: -not-found-any-more-by-lba=%d\n",
xorriso->loaded_boot_bin_lba);
Xorriso_toc_line(xorriso, flag & 8);
if(xorriso->loaded_boot_cat_path[0])
sprintf(respt, "Boot catalog : %s\n",
sprintf(respt, "Boot cat_path: %s\n",
Text_shellsafe(xorriso->loaded_boot_cat_path, sfe, 0));
else
sprintf(respt, "Boot catalog : -not-found-at-load-time-\n");
sprintf(respt, "Boot cat_path: -not-found-at-load-time-\n");
Xorriso_toc_line(xorriso, flag & 8);
if(bin_path_valid)
sprintf(respt, "Boot image : %s", Text_shellsafe(path, sfe, 0));
else if(xorriso->loaded_boot_bin_lba <= 0)
sprintf(respt, "Boot image : -not-found-at-load-time-");
else
sprintf(respt, "Boot image : -not-found-any-more-by-lba=%d",
xorriso->loaded_boot_bin_lba);
Xorriso__append_boot_params(respt, bootimg, 0);
strcat(respt, "\n");
Xorriso_toc_line(xorriso, flag & 8);
ret= iso_image_get_all_boot_imgs(image, &num_boots, &boots, &bootnodes, 0);
Xorriso_process_msg_queues(xorriso,0);
if(ret == 1 && num_boots > 1) {
for(i= 1; i < num_boots; i++) {
ret= Xorriso_path_from_node(xorriso, (IsoNode *) bootnodes[i], path, 0);
if(ret > 0)
sprintf(respt, "Boot image : %s", Text_shellsafe(path, sfe, 0));
else
sprintf(respt, "Boot image : -not-found-any-more-");
Xorriso__append_boot_params(respt, boots[i], 0);
strcat(respt, "\n");
Xorriso_toc_line(xorriso, flag & 8);
}
}
ret= 1;
ex:;
if(boots != NULL)
free(boots);
if(bootnodes != NULL);
free(bootnodes);
if(image != NULL)
iso_image_unref(image); /* release obtained reference */
return(ret);
return(1);
}

View File

@ -19,7 +19,7 @@
*/
#define xorriso_libisoburn_req_major 0
#define xorriso_libisoburn_req_minor 5
#define xorriso_libisoburn_req_micro 6
#define xorriso_libisoburn_req_micro 4
struct SpotlisT; /* List of intervals with different read qualities */
@ -491,17 +491,7 @@ int Xorriso_set_change_pending(struct XorrisO *xorriso, int flag);
/* @param flag bit0= enable SCSI command logging to stderr */
int Xorriso_scsi_log(struct XorrisO *xorriso, int flag);
/* flag bit0= do not increment boot_count and do not reset boot parameters
bit1= dispose attached boot images
*/
int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag);
/*
bit0= do only report non-default settings
bit1= do only report to fp
*/
int Xorriso_boot_image_status(struct XorrisO *xorriso, char *filter, FILE *fp,
int flag);
/* A pseudo file type for El-Torito bootsectors as in man 2 stat :
For now take the highest possible value.