Branching for libisoburn release 1.4.6

This commit is contained in:
Thomas Schmitt 2016-09-16 12:36:11 +00:00
parent 696a5d8bfe
commit d658408736
136 changed files with 136043 additions and 0 deletions

View File

@ -0,0 +1,3 @@
Thomas Schmitt
Vreixo Formoso Lopes

View File

View File

@ -0,0 +1,280 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS

View File

@ -0,0 +1,18 @@
Mario Danic <mario.danic@gmail.com>,
Vreixo Formoso <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
libisoburn is Copyright (C) 2007-2014 Vreixo Formoso, Thomas Schmitt
xorriso is Copyright (C) 2007-2014 Thomas Schmitt
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
or later as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

View File

@ -0,0 +1,751 @@
SVN trunk (to become libisoburn-1.4.6 or higher)
===============================================================================
* Bug fix: The default setting of -compliance did not apply rec_mtime to
Joliet and ISO:1999. mkisofs emulation was not affected by this bug.
* New command -use_immed_bit, new -as cdrecord option use_immed_bit=
* New -volume_date mode "all_file_dates"
* New -as mkisofs option --set_all_file_dates
* New bootspec "gpt_disk_guid=", new -as mkisofs option --gpt_disk_guid
* New -report_system_area modes "gpt_disk_guid", "make_guid"
* New environment variable SOURCE_DATE_EPOCH
* New -find action "set_to_mtime"
libisoburn-1.4.4.tar.gz Fri Jul 01 2016
===============================================================================
* Bug fix: -as mkisofs did not unescape "\=" in the source part of pathspecs
* Bug fix: -boot_image "any" "system_area=/dev/zero" did not zeroize loaded
data
* Bug fix: -pathspecs "on" did not properly handle "\\="
* Bug fix: HFS+ production could cause MBR partition of type 0xEE without GPT
* Bug fix: HFS+ directories could announce more children than they actually have
* Bug fix: The HFS+ filesystem was not marked by in GPT of GRUB2 hybrid layout
* Bug fix: When reading an ISO filesystem, the presence of
--protective-msdos-label was not recognized if a partition is
appended
* Bug fix: xorrisofs option --protective-msdos-label did not work if no
system area data were given by option -G or alike
* Bug fix: -modesty_on_drive properties timeout_sec, min_usec, max_usec
read wrong numbers from the parameter text
* Letting -as mkisofs --norock revoke the special effect of -r
* Letting -blank on overwritable media invalidate UDF extended descriptors
* New -pathspecs mode "as_mkisofs"
* New -boot_image setting mbr_force_bootable=, -as mkisofs --mbr-force-bootable
* New -boot_image bootspecs appended_part_as=apm, part_like_isohybrid=on
* New -as mkisofs options -appended_part_as_apm, -part_like_isohybrid
* New command -scsi_dev_family, new -as cdrecord option drive_scsi_dev_family=
libisoburn-1.4.2.tar.gz Sat Nov 28 2015
===============================================================================
* Bug fix: -backslash_codes "on" did not work outside quotes
and with showing "\r"
* New API calls isoburn_ropt_set_truncate_mode() isoburn_ropt_get_truncate_mode()
* New options with isoburn_ropt_set_extensions(): isoburn_ropt_map_*
* New command -modesty_on_drive,
new -as cdrecord -immed, minbuf=, modesty_on_drive=
* New command -ecma119_map
* New command -read_fs
* New -boot_image action "replay"
* New command -file_name_limit, -as mkisofs -file_name_limit
* New -find test -name_limit_blocker.
* Result of a Coverity audit: 50+ code changes, but no easy-to-trigger bugs
libisoburn-1.4.0.tar.gz Sun May 17 2015
===============================================================================
* Bug fix: -dev or -indev of medium with non-ISO data caused SIGSEGV by NULL
* New API calls isoburn_igopt_set_appended_as_gpt(),
isoburn_igopt_get_appended_as_gpt()
* New API call isoburn_igopt_set_part_flag() and libisofs interval reader flags
* New -find action "show_stream_id"
* Optional libisofs interval reader with -append_partition and System Area
* New -boot_image bootspec "appended_part_as=",
new -as mkisofs option -appended_part_as_gpt
* New -report_system_area formats "cmd" and "as_mkisofs"
libisoburn-1.3.8.tar.gz Sat Jun 28 2014
===============================================================================
* Bug fix: -boot_image grub grub2_mbr= did not work
(but -as mkisofs --grub2-mbr did work)
* Bug fix: -boot_image grub2_mbr= prevented -boot_image partition_table=on
* Bug fix: libburn: A final fsync(2) was performed with stdio drives,
even if -stdio_sync was set to "off".
* Bug fix: libburn: Wrong stack usage caused SIGBUS on sparc when compiled
by gcc -O2
* Bug fix: -blank force:all on DVD+RW had no effect
* Enabled use of libedit as alternative to libreadline
* Enabled recording and restoring of extattr on NetBSD
* New API calls isoburn_igopt_set_stdio_endsync() and
isoburn_igopt_get_stdio_endsync
* New bootspecs hppa_*, new -as mkisofs options -hppa-* for HP-PA via PALO
* New -find pseudo tests -use_pattern , -or_use_pattern
* New -find action report_sections
* New command -concat
* New commands -report_system_area and -report_el_torito
libisoburn-1.3.6.pl01.tar.gz Tue Mar 18 2014
===============================================================================
* Bug fix: Command -status produced FAILURE event if no drive was acquired
Regression introduced by release 1.3.6
* Bug fix: libburn : Compilation warning for unsupported systems mutated
into an error. Regression introduced by release 1.3.6.
* Bug fix: libburn : CD TAO with add-on sessions could cause a buffer overrun.
Introduced 7 years ago by release 0.3.2.
libisoburn-1.3.6.tar.gz Tue Mar 04 2014
===============================================================================
* Bug fix: libisofs: Division by zero if HFS+ was combined with TOC emulation
for overwritable media.
* Bug fix: -list_speeds did not work any more with old CD drives.
Regression introduced by release 1.3.4
* Bug fix: -check_media marked untested sectors in sector map as valid
* Bug fix: Paths with symbolic links preceding ".." were not interpreted
properly
* New isoburn_igopt_set_relaxed() relaxation isoburn_igopt_joliet_utf16
* New -compliance rule joliet_utf16, new -as mkisofs option -joliet-utf16
* New -find test -bad_outname, new -find action print_outname
* New API call isoburn_conv_name_chars()
* libburn: New system adapter for NetBSD
libisoburn-1.3.4.tar.gz Thu Dec 12 2013
===============================================================================
* Bug fix: Command -blank "as_needed" formatted blank BD-R.
* Bug fix: -as mkisofs option -log-file put the log file into the image
* Bug fix: -cut_out did not add x-permission to r-permission of directory
* Bug fix: Command -zisofs did not accept all options emitted by
-status -zisofs
* Bug fix: -blank force:... failed on appendable or closed media
* Bug fix: libburn: Drive LG BH16NS40 stalled on inspection of unformatted
DVD+RW
* libisofs: Default sort weight of El Torito boot images is now 2
* libisofs: Encoding HFS+ names in UTF-16 rather than UCS-2
* New command -read_speed
* New -close mode "as_needed", new -as cdrecord option --multi_if_possible
* New -alter_date types: a-c , m-c , b-c , c
libisoburn-1.3.2.tar.gz Wed Aug 07 2013
===============================================================================
* Bug fix: -find -exec "sort_weight" did not mark the image as having
pending changes
* Bug fix: -backslash_codes "with_program_arguments" was interpreted too late
* Bug fix: Missing or empty parameter with -dus was interpreted as "*" rather
than "."
* Bug fix: readline history was spammed by -msg_op parsing and pipe loops
* Bug fix: xorriso aborted on SIGCONT, SIGTSTP, SIGTTIN, SIGTTOU
* Improved granularity of SCSI log time measurement, now with timestamp
* New -pacifier behavior code "interval="
* New -as mkisofs options --sort-weight-list and --sort-weight-patterns
* New -format mode "without_spare" (for BD-RE)
* New command -named_pipe_loop
* New command -sh_style_result
* New -msg_op opcodes "parse_silently" and "parse_bulk_silently"
* New command -application_use and new -as mkisofs option --application_use
libisoburn-1.3.0.tar.gz Fri May 17 2013
===============================================================================
* Bug fix: Disk paths with components '.' or '..' could be mistaken for
directories.
* Bug fix: -as mkisofs -print-size failed with -isohybrid-mbr and a single
boot image. Regression introduced by libisoburn-1.2.8.
* Bug fix: -as mkisofs -path-list did not switch to --no-emul-toc by default.
* Bug fix: Unspecified Expiration Time and Effective Time of ISO volume was
represented by 0-bytes rather than ASCII '0' digits.
* Bug fix: Reserved and unused fields of APM entries were not zeroed.
* Bug fix: GPT header CRC was computed from all 512 bytes rather than from 92.
* Bug fix: The protective MBR partition for GPT started at block 0 instead of 1.
* New -boot_image bootspecs grub2_mbr= and grub2_boot_info=
* New -boot_image bootspec grub2_sparc_core=
* New -as mkisofs options --grub2-mbr , --grub2-boot-info , --grub2-sparc-core
* New -hardlinks mode "lsl_count" / "no_lsl_count"
libisoburn-1.2.8.tar.gz Mon Mar 18 2013
===============================================================================
* Bug fix: -tell_media_space altered the pointers to MD5 of data files
which stem from a previous session. This produced false
mismatches with -check_md5_r.
* Bug fix: CD tracks were reported with the sizes of the tracks in the
first session.
* Bug fix: -check_media use=outdev sector_map= stored TOC of input drive
* Bug fix: -hide hfsplus and -as mkisofs -hide-hfsplus had no effect.
Thanks to Davy Ho.
* Bug fix: ./configure did not abort if libburn.h or libisofs.h were missing
* New command -move
* New -as mkisofs options -eltorito-id , -eltorito-selcrit
libisoburn-1.2.6.tar.gz Tue Jan 08 2013
===============================================================================
* Bug fix: SIGSEGV by uninitialized local variable with
-check_media patch_lba0="on". Regression by version 1.0.6
* Bug fix: -partition_offset 16 kept -isohybrid-gpt-basdat from writing
MBR partition table entries of type 0xef
* Bug fix: -rollback did not work if indev and outdev were empty
* New API calls Xorriso_parse_line() and Xorriso__dispose_words()
* New API calls Xorriso_fetch_outlists() and Xorriso_peek_outlists()
* New API call Xorriso_start_msg_watcher()
* New API calls Xorriso__severity_cmp() and Xorriso__severity_list()
* New API calls Xorriso_sieve_add_filter, Xorriso_sieve_get_result,
Xorriso_sieve_clear_results, Xorriso_sieve_dispose, Xorriso_sieve_big
* New -boot_image partition_cyl_align mode "all"
* New -blank mode prefix "force:"
* New -osirrox settings "blocked" and "unblock"
* New command -lns for creating symbolic links
* New command -toc_of
* New command -msg_op
* New command -launch_frontend
* Proof-of-concept of a GUI frontend program: xorriso-tcltk written in Tcl/Tk.
libisoburn-1.2.4.tar.gz Fri Jul 20 2012
===============================================================================
* New API call isoburn_igopt_set_hfsp_serial_number()
* New API calls isoburn_igopt_set_prep_partition, isoburn_igopt_set_efi_bootp
* New API calls isoburn_igopt_set_hfsp_block_size() and isoburn_igopt_get_hfsp_block_size()
* New -check_media option async_chunks=
* New xorriso command -write_type
* New xorriso command -rockridge
* New xorriso command -hfsplus
* New -find tests -has_hfs_crtp, has_hfs_bless
* New -find actions set/get_hfs_crtp, set/get_hfs_bless
* New -find test -disk_path
* New -boot_image bootspec hfsplus_serial=
* New -boot_image bootspecs hfsplus_block_size= and apm_block_size=
* New -boot_image bootspecs efi_boot_part, prep_boot_part, chrp_boot_part
* Command -hide allows hiding in HFS+ filesystem
* New -as cdrecord options -tao -sao -dao
* New -as mkisofs option -log-file
* New -as mkisofs option --norock
* New -as mkisofs option -hfsplus
* New -as mkisofs option -hfsplus-file-creator-type
* New -as mkisofs options -hfs-bless and -hfs-bless-by
* New -as mkisofs option -hfsplus-serial-no
* New -as mkisofs options -hfsplus-block-size and -apm-block-size
* New -as mkisofs option -hide-hfsplus, -hide-hfsplus-list
* New -as mkisofs options -prep-boot-part, -efi-boot-part, -chrp-boot-part
* New -as mkisofs options -isohybrid-gpt-basdat, -isohybrid-gpt-hfsplus, -isohybrid-apm-hfsplus
* Bug fix: Memory corruption when reading bootable image that was truncated
* Bug fix: -update deleted MD5 of files of which only attributes had changed
libisoburn-1.2.2.tar.gz Mon Apr 02 2012
===============================================================================
* New API calls isoburn_get_attached_start_lba(), isoburn_attach_start_lba()
* New API calls isoburn_igopt_set_rr_reloc(), isoburn_igopt_get_rr_reloc()
* New API calls isoburn_ropt_set_data_cache(), isoburn_ropt_get_data_cache()
* New commands -x, -list_arg_sorting
* New command -rr_reloc_dir
* New command -data_cache_size
* New -as mkisofs option -rr_reloc, implemented option -hide-rr-moved
* Now ignoring -as mkisofs -no-split-symlink-components -no-split-symlink-fields
* Bug fix: -osirrox on:sort_lba_on -extract from / restored nearly nothing
* Bug fix: -as mkisofs without -graft-points could not handle names with "="
* Bug fix: Relaxation options joliet_rec_mtime and iso1999_rec_mtime had wrong values
libisoburn-1.2.0.tar.gz Sat Jan 28 2012
===============================================================================
* Bug fix: mkisofs emulation did not record mtime in ECMA-119 directories
* Bug fix: Program abort while drive tray is loading led to endless loop
* Bug fix: Solaris adapter mishandled write commands which failed on first try
* Bug fix: libisoburn.ver had a duplicate function entry
* New relaxations isoburn_igopt_joliet_rec_mtime,
isoburn_igopt_iso1999_rec_mtime
* Made -compliance "rec_mtime" default for xorriso
libisoburn-1.1.8.tar.gz Mon Nov 21 2011
===============================================================================
* Info document and man page for xorrecord
* New option -sleep
* Enabled recognition of QEMU DVD-ROM 0.12
* Enabled out-of the box use of xorriso on Linux guest on qemu virtio-blk-pci
libisoburn-1.1.6.tar.gz Tue Sep 27 2011
===============================================================================
* Bug fix: -extract_single extracted directory content
* Bug fix: -extract was not immediately aborted if -abort_on was triggered
* Bug fix: xorriso did not write to files in filesystems with >= 4 TB free space
* Bug fix: libisofs: ACL entries of groups and of user id 0 were not properly
recorded and cannot be restored
* Bug fix: libisofs: No ACLs were recorded on FreeBSD
* Enabled recording and restoring of extattr on FreeBSD.
* New option -list_extras
* New -osirrox option strict_acl
* New -find and -findx action list_extattr
* Workaround for collision with Linux udev which lets device links vanish
libisoburn-1.1.4.tar.gz Mon Aug 8 2011
===============================================================================
* Bug fix: xorriso native mode on some drives wrote unreadble ISO images to CD
* Bug fix: -assert_volid did not work. Regression since version 1.1.0.
* Bug fix: -acl or -xattr worked with -extract only on Linux and FreeBSD
* New option -device_links
libisoburn-1.1.2.tar.gz Fri Jul 8 2011
===============================================================================
* Bug fix: Since 1.0.6: Unreadable image produced by: xorrisofs ... >image.iso
* Bug fix: -update_r scheduled non-existing files for hardlink update
* Enabled extraction of the boot catalog file to disk filesystem
* New option -list_speeds
GNU xorriso-1.1.0.pl01.tar.gz Mon Jun 20 2011
===============================================================================
* Bug fix: Due to a bug in libburn-1.1.0, GNU xorriso-1.1.0 compiled only
on GNU/Linux, FreeBSD, and Solaris, but not on other systems.
libisoburn-1.1.0.tar.gz Sat Jun 18 2011
===============================================================================
* Bug fix: -mount_opts shared worked only with -osirrox o_excl_off
* Bug fix: xorriso command -add_plainly "any" did not add all files to the image
* Bug fix: The attempt to blank already blank DVD-RW was not gracefully blocked
* Bug fix: -as mkisofs -isohybrid-mbr without -no-pad was not cylinder aligned
* New option -signal_handling
* New option -close_damaged
* Dropped suffix .plXY from tarball name
libisoburn-1.0.8.pl00.tar.gz Thu Apr 14 2011
===============================================================================
* Bug fix: mkisofs emulation could ignore options (regression in 0.1.6)
libisoburn-1.0.6.pl00.tar.gz Sat Apr 9 2011
===============================================================================
* Bug fix: -as mkisofs padding did not work (regression in 1.0.4)
* Bug fix: Options -gid and -uid had no effect
* New API call isoburn_set_truncate()
* New relax option isoburn_igopt_joliet_long_names
* New option -early_stdio_test
* New options -print_info and -print_mark
* New -compliance option joliet_long_names
* -as mkisofs option -joliet-long is now fully functional
* Burning DVD-R DAO with 2 kB size granularity rather than 32 kB
libisoburn-1.0.4.pl00.tar.gz Thu Mar 10 2011
===============================================================================
libisoburn novelties:
* New isoburn_ropt_set_extensions() option isoburn_ropt_nomd5tag
xorriso novelties:
* Bug fix: xorrisofs did not work under growisofs -M (version 1.0.0 was ok)
* Bug fix: -as mkisofs -C attempted to read volume header of blank media
* Bug fix: -as mkisofs -old-root did not work with -graft-points
* Bug fix: -as mkisofs -partition_hd_cyl had no effect
* Bug fix: -as mkisofs did not properly unescape target part of pathspecs
* Bug fix: isohybrid image size was not aligned to cylinder boundary
* Bug fix: Compilation without zlib failed
* New -padding modes "included" and "appended"
* New bootspec partition_cyl_align=, new -as mkisofs option -partition_cyl_align
* New -as mkisofs and -as cdrecord option --no_rc
* Own man page and info document for xorrisofs
libisoburn-1.0.2.pl00.tar.gz Mon Feb 23 2011
===============================================================================
libisoburn novelties:
* Removed compiler obstacles of GNU xorriso on Solaris 9
* New isoburn_igopt_set_extensions() option isoburn_igopt_old_empty
xorriso novelties:
* Bug fix: Images produced with -for_backup might be unreadable and
also fail -check_md5 verification.
* Bug fix: mkisofs emulation options -l , -full-iso9660-filenames did not work.
* Bug fix: Option -mkdir yielded SIGSEGV due to a NULL pointer
* Bug fix: ECMA-119 standards violation with Volume Descriptor Set Terminator
* New options -clone and -cp_clone
* New -find actions update_merge, rm_merge, clear_merge
* New -as mkisofs option -max-iso9660-filenames
* New -as mkisofs option --old-empty
* New -as mkisofs options -root , -old-root
* New -as mkisofs options --old-root-no-md5, --old-root-no-ino, --old-root-dev
libisoburn-1.0.0.pl00.tar.gz Mon Jan 17 2011
===============================================================================
libisoburn novelties:
* New API call isoburn_igopt_set_untranslated_name_len()
xorriso novelties:
* Bug fix: -as mkisofs -print-size did not account for -partition_offset
* Default -abort_on value is now "FAILURE" with batch and "NEVER" with dialog
* New -compliance options untranslated_names , untranslated_name_len=
* New -as mkisofs option -untranslated_name_len
* New -compliance option iso_9660_1999, -as mkisofs option -iso-level 4
* New -compliance option iso_9660_level=number
* New -compliance option allow_dir_id_ext, -as mkisofs -disallow_dir_id_ext
* Disabled TOC emulation with -as mkisofs. May be re-enabled by --emul-toc.
libisoburn-0.6.6.pl00.tar.gz Sun Dec 12 2010
===============================================================================
libisoburn novelties:
* New API calls isoburn_igopt_set_disc_label(), isoburn_igopt_get_disc_label()
* New API calls isoburn_ropt_set_displacement(), isoburn_ropt_get_displacement()
xorriso novelties:
* Bug fix: -as mkisofs -print-size printed the size but also produced ISO image
* Build problem fix on Linux 2.4 in GNU xorriso libjte/checksum.c
* New -as mkisofs option -joliet-long
* New bootspec sparc_label=, new -as mkisofs options -sparc-boot , -sparc-label
* New option -displacement
libisoburn-0.6.4.pl00.tar.gz Tue Oct 26 2010
===============================================================================
libisoburn novelties:
* New API call isoburn_libjte_req()
* New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte()
* New API call isoburn_igopt_set_tail_blocks()
* New API call isoburn_libjte_req()
xorriso novelties:
* New option -jigdo
* New -as mkisofs options -jigdo-* and -md5-list as of genisoimage
* New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template
* New bootspecs mips_path= and mipsel_path= for Debian MIPS releases
* New -as mkisofs options -mips-boot and -mipsel-boot
* New option -append_partition, -as mkisofs -append_partition
libisoburn-0.6.2.pl00.tar.gz Sat Sep 18 2010
===============================================================================
libisoburn novelties:
* New API function isoburn_igopt_set_part_offset()
* Hiding all non-API symbols from the linker by use of --version-script
* Now with history of release notes in ./ChangeLog file.
xorriso novelties:
* Bug fix: Regression with -hardlinks and -compliance old_rr, 0.4.2, Aug 2009
* New option -preparer_id, -as mkisofs options -p and -preparer
* New -boot_image specifier emul_type=none|hard_disk|floppy
* New boot_image boot specs partition_offset,partition_hd_cyl,partition_sec_hd
* Made behavior of -as mkisofs with unknown options more similar to original
* New -as mkisofs option -hard-disk-boot, enabled -b without -no-emul-boot
* New -as mkisofs option -e from Fedora genisoimage
* New -as mkisofs options -partition_offset,-partition_hd_cyl,-partition_sec_hd
libisoburn-0.6.0.pl00.tar.gz Fri Jul 02 2010
===============================================================================
libisoburn novelties:
xorriso novelties:
* New option -read_mkisofsrc interprets .mkisofsrc To be performed before -as
mkisofs. Performed automatically with program alias name "xorrisofs".
* Implemented -as mkisofs options -dir-mode, -file-mode, -abstract, -biblio,
-copyright
* Implemented -as mkisofs options -hide, -hide-joliet, -hide-list,
-hide-joliet-list
* New -as mkisofs option --boot-catalog-hide
* New option -hide, -find action -hide, -find test -hidden
* New -boot_image bootspec cat_hidden=on
* New options -copyright_file , -biblio_file , -abstract_file
* New find test -disk_name
* Enabled use of libreadline on Solaris
* Bug fix: -check_media patch_lba0= could install wrong image size
* Bug fix: -as mkisofs option -volset was wrongly interpreted like -volid
libisoburn-0.5.8.pl00.tar.gz Mon Jun 14 2010
===============================================================================
libisoburn novelties:
* xorriso source split into more modules, object code moved into libisoburn
xorriso novelties:
* New write extension option isoburn_igopt_no_emul_toc
* New -compliance rule no_emul_toc, new -as mkisofs --no-emul-toc
* Implemented -as cdrecord -V
* Implemented -as mkisofs options -U, -N, -l, -d, -allow-lowercase
libisoburn-0.5.6.pl00.tar.gz Tue May 04 2010
===============================================================================
libisoburn novelties:
xorriso novelties:
* 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
libisoburn-0.5.4.pl00.tar.gz Mon Apr 19 2010
===============================================================================
libisoburn novelties:
* New API call isoburn_igopt_set_system_area()
* New API call isoburn_igopt_set_pvd_times()
* New isoburn_igopt_set_relaxed() options: only_iso_versions, no_j_force_dots
xorriso novelties:
* New -boot_image any system_area=, -as mkisofs option -G
* New -boot_image grub partition_table=on, -as mkisofs --protective-msdos-label
* New -boot_image isolinux partition_table=on, -as mkisofs -isohybrid-mbr
* New option -volume_date, -as mkisofs --modification-date=
* New -find action mkisofs_r,-as mkisofs -r
* New -find action sort_weight, -as mkisofs --sort-weight
* New -compliance options only_iso_version, no_j_force_dots avoid
a bug in GRUB 1.96. They are default now.
libisoburn-0.5.2.pl00.tar.gz Tue Mar 30 2010
===============================================================================
xorriso novelties:
* xorriso documentation is now based on a hybrid format of Texinfo and man-
page. Copies included: .texi, .info, .1 (man page)
libisoburn-0.5.0.pl00.tar.gz Tue Feb 22 2010
===============================================================================
xorriso novelties:
* The former xorriso-standalone project is now GNU xorriso under GPLv3+. This
affects some documentation and the generator script, but not the license of
libisoburn or its program xorriso.
* Bug fix: xorriso -update_r could lead to SIGSEGV if applied to a data file
rather than a directory.
* Bug fix on FreeBSD: xorriso could leave the drive tray locked.
* New option -scsi_log
libisoburn-0.4.8.pl00.tar.gz Tue Jan 26 2010
===============================================================================
xorriso novelties:
* Bug fix: xorriso did not blank CD-RW with images that were prepared
on hard disk.
* New configure option --enable-libcdio for system adapter to libcdio-0.83git
libisoburn-0.4.6.pl00.tar.gz Wed Dec 09 2009
===============================================================================
xorriso novelties:
* New options -dvd_obs and -stdio_sync
* New configure option --enable-dvd-obs-64k
libisoburn-0.4.4.pl00.tar.gz Wed Oct 28 2009
===============================================================================
xorriso novelties:
* Bug fix: With -as cdrecord : -xa1 and -xamix were ignored although they do
matter.
* Option -toc now reports the individual media type. E.g. with a DVD+RW:
"Media product: RICOHJPN/W11/49 , Ricoh Company Limited"
* New option -pvd_info displays image id strings. New options -system_id , -
volset_id allow to set such image id strings.
* New option -mount_opts tries to circumvent an eventual ban to mount the same
device twice. Some Linux systems allow to mount two sessions of the same
media only if they get fooled via the loop device.
* New option -scdbackup_tag performs the task of the scdbackup MD5 checksum
filter inside xorriso.
Already fixed by patch releases of xorriso-0.4.2:
* Bug fix: -cut_out deleted previously cut-out pieces of the same file
* Bug fix libisofs: Filenames could lose blanks during a multi-session cycle
* Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen
yet
* Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help
libisoburn-0.4.2.pl02.tar.gz Thu Oct 08 2009
===============================================================================
* Bug fix: -for_backup did not enable -xattr and -md5 if no drive was chosen
yet
* Bug fix: xorrisofs -help, xorrecord -help displayed original xorriso -help
Libisoburn 0.4.2.pl01
===============================================================================
* Bug fix: xorriso option -cut_out deleted previously cut-out pieces of the
same file. The bug was introduced with release 0.1.4 in March 2008.
Libisoburn 0.4.2
===============================================================================
* New write options isoburn_igopt_session_md5, isoburn_igopt_file_md5,
isoburn_igopt_file_stability allow to record MD5 checksums of session and
single data files.
* New read option isoburn_ropt_nomd5 allows to read those MD5 sums when
importing an ISO image.
xorriso novelties:
* New option -md5, new -as mkisofs option --md5 allow to record in the image
MD5 checksums for the whole session and for each single data file.
* New options -check_md5, -check_md5_r allow to verify the whole session or
single files by comparing their image data with their MD5 sums.
* Options -compare, -compare_r, -update, update_r now can use recorded MD5.
* New -find actions check_md5, get_md5, make_md5 allow to check, to display or
to recompute MD5 checksums of data files. New find test -has_md5
distinguishes data files which have recorded MD5 from files which have none.
* New -find test -has_any_xattr and action get_any_xattr allow to inspect the
libisofs specific attributes of namespace "isofs".
* Options -lsl and lsdl now display correct link counts if -hardlinks is on.
* New option -calm_drive allows to reduce drive noise if no data reading is
intended for a while.
* New option -list_profiles allows to inquire and process the list of supported
media types.
* Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs
any more. (Already fixed by release 0.4.0.pl01, 20 Jul 2009)
libisoburn-0.4.0.pl01.tar.gz Mon Jul 20 2009
===============================================================================
xorriso novelties:
* New option -hardlinks enables recording and restoring of hard link relations.
* Improved reading performance with -update_r and -extract.
* New option -for_backup as shortcut for -acl -xattr -hardlinks
* Operators with option -find : -not, -or, -and, (, ), -if, -then, -else
* New -find tests -wholename, -prune
* Bug fix: SIGSEGV with option -status and no search string
* Bug fix: -load volid did not perform pattern search
* Bug fix: Copies of overwriteable media on sequential were mistaken in ROM
drives
Libisoburn 0.4.0.pl01 release notes:
* Bug fix: xorriso -as mkisofs did not understand the -C option of growisofs
any more
libisoburn-0.3.8.pl00.tar.gz Sun Apr 19 2009
===============================================================================
libisoburn novelties:
* New API calls isoburn_ropt_set_auto_incharset() and
isoburn_ropt_get_auto_incharset()
xorriso novelties:
* New options -set_filter, -set_filter_r, -find -exec set_filter allow to
manipulate the content of data files on the fly.
* New option -zisofs, built-in filters --zisofs , --gzip , --gunzip enable
compression and decompression of data file content.
* New options -external_filter , -unregister_filter, -close_filter_list allow
arbitrary external processes to do content filtering.
* New options -show_stream, -show_stream_r allow to inspect the origin and the
filters of data files in an emerging image.
* New option -auto_charset based on xattr "isofs.cs" allows to tag an ISO
filesystem image with the character set name that is in use on the current
terminal.
libisoburn-0.3.6.pl00.tar.gz Mon Mar 16 2009
===============================================================================
xorriso novelties:
* Dummy MMC adapter of libburn allows compilation on systems other than Linux,
FreeBSD
* Default of -compliance has been changed to "old_rr", new rule "new_rr"
* New -stream_recording modes with start address or "data". "on" is now 32s.
libisoburn-0.3.4.pl00.tar.gz Sun Mar 01 2009
===============================================================================
* New isoburn_read_opts values: isoburn_ropt_noaaip, isoburn_ropt_noacl,
isoburn_ropt_noea
xorriso novelties:
* New option -acl enables ACL import and export
* New options -getfacl, -getfacl_r, -setfacl, -setfacl_r, -setfacl_list
* New find tests -has_acl, -has_no_acl , new find actions getfacl, setfacl
* New option -xattr enables import and export of Extended Attributes
* New options -getfattr, -getfattr_r, -setfattr, -setfattr_r, -setfattr_list
* New find tests -has_xattr, -has_aaip, new find actions getfattr, setfattr
* New -as mkisofs options --acl and --xattr
* New option -disk_dev_ino accelerates incremental backups
libisoburn-0.3.2.pl00.tar.gz Tue Jan 06 2009
===============================================================================
* New API function isoburn_get_mount_params()
* Now depending on libburn-0.6.0 which supports BD-R media
xorriso novelties:
* Bug fix: Options -extract and -extract_single were enabled with -osirrox off
* New options -mount , -mount_cmd , -session_string
* New -format modes by_size_ and fast_by_size_
* New option -assert_volid
* New option -drive_class for safety management of pseudo-drive access
libisoburn-0.3.0.pl00.tar.gz Tue Dec 2 2008
===============================================================================
* Now depending on libisofs-0.6.12 and libburn-0.5.6 to ensure use of their
recent bug fixes
xorriso novelties:
* New options -quoted_path_list, -quoted_not_list
* New option -backslash_codes for weird file names and terminal safety
* New options -charset, -in_charset, -out_charset
* New option -local_charset allows to override locale
* New option -application_id
* New option -compliance allows certain deviations from standards
* Suitable ISOLINUX boot images are made alternatively bootable via an MBR
* Bug fix: Forgot exit value registration to -return_with.
Thanks to Steve Dodd.
* Bug fix: -format as_needed did not recognize unformatted BD-RE
* Bug fix: disk patterns with relative addresses were not properly resolved
libisoburn-0.2.8.pl00.tar.gz Wed Oct 15 2008
===============================================================================
* Now depending on libisofs-0.6.10 and libburn-0.5.4 to ensure use of their
recent bug fixes
xorriso novelties:
* Ability to write and maintain bootable ISO images based on ISOLINUX
* New ./configure option --disable-libreadline to make binary more portable
* Bug fix: -as mkisofs -iso-level was accused to be an unknown option
* Bug fix: -follow link attributed random target filenames to looping links
libisoburn-0.2.6.pl00.tar.gz Sat Sep 20 2008
===============================================================================
xorriso novelties:
* Capability to insert and extract files far larger than 4 GB
* New option -file_size_limit, -as mkisofs now supports -iso-level 1 to 3
* New option -extract_cut
* New -error_behavior "file_extraction" behavior "best_effort"
* New option -check_media_defaults
* New option -list_delimiter
* Bug fix: -format full did not re-format already formatted DVD+RW
libisoburn-0.2.4.pl00.tar.gz Mo Aug 25 2008
===============================================================================
xorriso novelties:
* New option -check_media
* New -find test -damaged, new -find actions "report_damage", "report_lba"
* New -error_behavior occasion "file_extraction"
libisoburn-0.2.2.pl01.tar.gz Fr Jul 25 2008
===============================================================================
Libisoburn 0.2.2 release notes (Jul 19 2008)
* New API function isoburn_prepare_blind_grow()
* New flag bits with isoburn_set_msc1(), isoburn_read_iso_head()
xorriso novelties:
* New option -grow_blindly
* Options -C and -M for -as mkisofs emulation
* Options for -as cdrecord emulation: -multi, -msinfo, -isosize, tsize, --
grow_overwriteable_iso, write_start_address,
* New option -pacifier, more compatible pacifier with -as mkisofs
* make install creates aliases as symbolic links: osirrox, xorrisofs, xorrecord
* Can serve growisofs if started as xorrisofs, genisofs, mkisofs, genisoimage
pl01 changes (Jul 25 2008):
* Bug fix: Variable DESTDIR was not properly respected during make install
libisoburn-0.2.0.pl00.tar.gz Mon Jun 23 2008
===============================================================================
Libisoburn 0.2.0 release notes:
* New API functions isoburn_set_msgs_submit(), isoburn_drive_set_msgs_submit()
xorriso novelties:
* Bug fix: -chmod unintentionally performed o-x as first operation
* New options -cpax, -cp_rx, -cp_rax, -extract to restore files and trees from
ISO image to disk filesystem.
* New option -paste_in to copy ISO files into parts of disk files
* New options -map_l, -compare_l, -update_l, -extract_l
libisoburn-0.1.8.pl00.tar.gz Tue Jun 3 2008
===============================================================================
* Bug fix: Major,minor numbers of device files appeared as 0,1 in next session
* Bug fix: modifying to overwriteable target yielded unmountable results
xorriso novelties:
* New option -stream_recording for full speed with DVD-RAM and BD-RE
* New options -osirrox and -cpx allow to extract single files from ISO image
libisoburn-0.1.6.pl00.tar.gz Mon May 19 2008
===============================================================================
* Support for BD-RE (by depending on libburn-0.4.8)
* New API wrapper calls isoburn_toc_*() around libburn TOC inquiry calls
* New API call isoburn_read_iso_head() identifies ISO 9660 filesystems
* New API call isoburn_set_msc1() (like mount -o sbsector=)
xorriso novelties:
* Bug fix: -update_r and others did not work properly with relative paths
* New options -map and -map_single
* New options -not_paths, -not_leaf, -not_list, -not_mgt, -as mkisofs -m
* Emulated -toc on overwriteable media, new -toc layout with volume id
* New option -load makes alternative sessions accessible
* New -blank and -format modes 'as_needed'
* New option -list_formats and -format mode 'by_index_'
libisoburn-0.1.4.pl00.tar.gz Wed Apr 30 2008
===============================================================================
* Improved performance with reading directory trees
* xorriso: Improved attribute transfer from disk for target
* xorriso: Incremental backup functionality by new option -update_r
* xorriso: Options -cut_out and split_size map byte intervals of oversized
files into ISO files
* xorriso: Emulation of some basic mkisofs and cdrecord options
* Dynamically linkable with release version 0.6.4 of libisofs
Version 0.1.2 was not released as libisoburn
but only as xorriso standalone version. Wed Mar 12 2008
===============================================================================
* Bug fix: -report_about HINT or higher did not report at all
* Bug fix: speed=number without unit or media type letter was always CD speed
* Bug fix: it was possible to write to appendable media which was not -indev
* Bug fix: -follow param did not work for adding non-directory symbolic links
* Bug fix: It was not possible to -add /THIS=a /b=THIS
* Improved attribute transfer from disk for implicit target directories
* New option -as "cdrecord" emulates a narrow set of cdrecord gestures
* New option -as "mkisofs" emulates a narrow set of mkisofs gestures
* New option -publisher
* New option -errfile_log
* Support for DVD+R/DL media
* New options -compare, -compare_r and according -find -exec action
* New options -update, -update_r and according -find -exec action
* New -find actions "rm", "rm_r", new -findx -type "m" -exec "empty_iso_dir"
* New option -cut_out
libisoburn-0.1.0.pl01.tar.gz Fri Feb 15 2008
===============================================================================
* Initial release of libisoburn/xorriso
* libisoburn connects libisofs and libburn
* libisoburn emulates multi-session on media without session history
* xorriso is an integrated multi-session tool for ISO 9660 Rock Ridge images
* due to a subtle mistake in ABI usage with libisofs this release had to be
restricted to dynamic linking with exactly libisofs-0.6.2 where the mistake
does no harm. A version of libisoburn which is open to all future libisofs
versions will be released shortly after libisofs.0.6.4.

View File

@ -0,0 +1,237 @@
See file README for libisoburn and xorriso specific installation instructions.
This file here is rather a manual for advanced usage of ./configure
-------------------------------------------------------------------
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View File

@ -0,0 +1,297 @@
# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4
# was: pkgconfigdir=$(libdir)/pkgconfig
pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
libincludedir=$(includedir)/libisoburn
lib_LTLIBRARIES = libisoburn/libisoburn.la
ACLOCAL_AMFLAGS = -I ./
## ========================================================================= ##
# Build libraries
libisoburn_libisoburn_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) $(LIBLDFLAGS)
libisoburn_libisoburn_la_SOURCES = \
libisoburn/isoburn.h \
libisoburn/libisoburn.h \
libisoburn/burn_wrap.c \
libisoburn/data_source.c \
libisoburn/isoburn.c \
libisoburn/isofs_wrap.c \
\
xorriso/xorriso.h \
xorriso/xorriso_private.h \
xorriso/sfile.h \
xorriso/sfile.c \
xorriso/aux_objects.h \
xorriso/aux_objects.c \
xorriso/findjob.h \
xorriso/findjob.c \
xorriso/check_media.h \
xorriso/check_media.c \
xorriso/misc_funct.h \
xorriso/misc_funct.c \
xorriso/text_io.h \
xorriso/text_io.c \
xorriso/match.h \
xorriso/match.c \
xorriso/emulators.h \
xorriso/emulators.c \
xorriso/disk_ops.h \
xorriso/disk_ops.c \
xorriso/cmp_update.h \
xorriso/cmp_update.c \
xorriso/parse_exec.h \
xorriso/parse_exec.c \
xorriso/opts_a_c.c \
xorriso/opts_d_h.c \
xorriso/opts_i_o.c \
xorriso/opts_p_z.c \
\
xorriso/xorrisoburn.h \
xorriso/base_obj.h \
xorriso/base_obj.c \
xorriso/lib_mgt.h \
xorriso/lib_mgt.c \
xorriso/sort_cmp.h \
xorriso/sort_cmp.c \
xorriso/drive_mgt.h \
xorriso/drive_mgt.c \
xorriso/iso_img.h \
xorriso/iso_img.c \
xorriso/iso_tree.h \
xorriso/iso_tree.c \
xorriso/iso_manip.h \
xorriso/iso_manip.c \
xorriso/write_run.h \
xorriso/write_run.c \
xorriso/read_run.h \
xorriso/read_run.c \
xorriso/filters.h \
xorriso/filters.c \
xorriso/xorriso_timestamp.h \
xorriso/xorriso_buildstamp.h
libisoburn_libisoburn_la_LIBADD = \
$(THREAD_LIBS) \
-lisofs \
-lburn
libinclude_HEADERS = \
libisoburn/libisoburn.h \
xorriso/xorriso.h
# libisoburn_libisoburn_la_CFLAGS = $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \
# $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) \
# $(XORRISO_DVD_OBS_64K)
## ========================================================================= ##
# This is the reference application of libisoburn. See man xorriso/xorriso.1
#
bin_PROGRAMS = \
xorriso/xorriso
# This looks quite ugly with make install: xorriso.c is compiled twice again
#
# Trying to create a build timestamp file
#
# BUILT_SOURCES = xorriso/xorriso_buildstamp.h
#
# phony targets get rebuilt every time
#
# .PHONY: xorriso/xorriso_buildstamp.h
# xorriso/xorriso_buildstamp.h:
# date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h
# cat xorriso/xorriso_buildstamp.h
xorriso_xorriso_CPPFLAGS = -Ilibisoburn
# xorriso_xorriso_CFLAGS = $(READLINE_DEF) $(LIBACL_DEF) $(XATTR_DEF) \
# $(EXTF_DEF) $(EXTF_SUID_DEF) $(ZLIB_DEF) \
# $(XORRISO_DVD_OBS_64K)
xorriso_xorriso_LDADD = libisoburn/libisoburn.la -lisofs -lburn \
$(THREAD_LIBS) $(LIBBURN_ARCH_LIBS)
xorriso_xorriso_SOURCES = \
xorriso/xorriso.h \
xorriso/xorriso_main.c
# Install symbolic links to the xorriso binary
#
install-exec-hook:
if test -e "$(DESTDIR)$(bindir)"/xorrisofs ; then rm "$(DESTDIR)$(bindir)"/xorrisofs ; else echo ; fi
ln -s xorriso "$(DESTDIR)$(bindir)"/xorrisofs
if test -e "$(DESTDIR)$(bindir)"/osirrox ; then rm "$(DESTDIR)$(bindir)"/osirrox ; else echo ; fi
ln -s xorriso "$(DESTDIR)$(bindir)"/osirrox
if test -e "$(DESTDIR)$(bindir)"/xorrecord ; then rm "$(DESTDIR)$(bindir)"/xorrecord ; else echo ; fi
ln -s xorriso "$(DESTDIR)$(bindir)"/xorrecord
$(LIBBURNIA_LDCONFIG_CMD) "$(DESTDIR)$(libdir)" || echo 'NOTE: Explicit dynamic library configuration failed. If needed, configure manually for:' "$(DESTDIR)$(libdir)"
# Alternative to the disabled .PHONY above.
# Trying to create a build timestamp file semi-manually: make buildstamped
#
buildstamp:
date -u '+#define Xorriso_build_timestamP "%Y.%m.%d.%H%M%S"' >xorriso/xorriso_buildstamp.h
cat xorriso/xorriso_buildstamp.h
# For now make buildstamped has to be performed explicitly.
buildstamped: buildstamp
make
# "make clean" shall remove a few stubborn .libs directories
# which George Danchev reported Dec 03 2011.
# Learned from: http://www.gnu.org/software/automake/manual/automake.html#Clean
clean-local:
-rm -rf test/.libs
# Will be executed by "make check"
check-local:
xorriso/xorriso -no_rc -version -list_extras all
## Build companion applications
noinst_PROGRAMS = \
test/compare_file \
xorriso/make_xorriso_1
# A program to compare two files in mirrored trees in mounted filesystems
# To compare tree /media/dvd and /original/dir :
# find /media/dvd -exec test/compare_file '{}' /media/dvd /original/dir ';'
#
test_compare_file_CPPFLAGS =
test_compare_file_CFLAGS =
test_compare_file_LDADD =
test_compare_file_SOURCES = test/compare_file.c
# Specialized converter from xorriso/xorriso.texi to xorriso/xorriso.1
#
xorriso_make_xorriso_1_CPPFLAGS =
xorriso_make_xorriso_1_CFLAGS =
xorriso_make_xorriso_1_LDADD =
xorriso_make_xorriso_1_SOURCES = xorriso/make_xorriso_1.c
# A Proof-of-concept for frontends
bin_SCRIPTS = \
frontend/xorriso-tcltk
## ========================================================================= ##
## Build documentation (You need Doxygen for this to work)
webhost = http://libburn-api.pykix.org
webpath = /
docdir = $(DESTDIR)$(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc: doc/html
doc/html: doc/doxygen.conf
if [ -f ./doc/doc.lock ]; then \
$(RM) -r doc/html; \
doxygen doc/doxygen.conf; \
fi
doc-upload: doc/html
scp -r $</* $(webhost):$(webpath)
## Not by default any more.
## It is unclear who is supposed to create file ./doc/doc.lock
# all: doc
install-data-local:
if [ -f ./doc/doc.lock ]; then \
$(mkinstalldirs) $(docdir)/html; \
$(INSTALL_DATA) doc/html/* $(docdir)/html; \
fi
uninstall-local:
rm -rf $(docdir)
## ========================================================================= ##
# Indent source files
indent_files = \
$(libisoburn_libisoburn_la_SOURCES)
indent: $(indent_files)
indent -bad -bap -nbbb -nbbo -nbc -bli0 -br -bls \
-cdw -ce -cli0 -ncs -nbfda -i8 -l79 -lc79 \
-lp -saf -sai -nprs -npsl -saw -sob -ss -ut \
-sbi0 -nsc -ts8 -npcs -ncdb -fca \
$^
.PHONY: indent
## ========================================================================= ##
# Extra things
nodist_pkgconfig_DATA = \
libisoburn-1.pc
man_MANS = \
xorriso/xorriso.1 \
xorriso/xorrisofs.1 \
xorriso/xorrecord.1
info_TEXINFOS = \
xorriso/xorriso.texi \
xorriso/xorrisofs.texi \
xorriso/xorrecord.texi
# To have a file in releng_generated_data. If the directory itself is listed
# in Makefile.am EXTRA_DIST, then its .svn subdir gets into the tarball.
releng/releng_generated_data/placeholder:
touch releng/releng_generated_data/placeholder
EXTRA_DIST = \
bootstrap \
libisoburn-1.pc.in \
version.h.in \
doc/comments \
doc/doxygen.conf.in \
doc/partition_offset.wiki \
doc/qemu_xorriso.wiki \
doc/startup_file.txt \
frontend/frontend_pipes_xorriso.c \
frontend/README-tcltk \
frontend/xorriso-tcltk \
frontend/sh_on_named_pipes.sh \
frontend/xorriso_broker.sh \
frontend/grub-mkrescue-sed.sh \
README \
AUTHORS \
CONTRIBUTORS \
COPYRIGHT \
COPYING \
INSTALL \
ChangeLog \
libisoburn/libisoburn.ver \
xorriso/changelog.txt \
xorriso/xorriso_buildstamp_none.h \
xorriso/README_gnu_xorriso \
xorriso/make_docs.sh \
releng/README \
releng/auto_cxx \
releng/auto_isocontent \
releng/auto_printsize \
releng/change_shell_to_use \
releng/codesamples/api_3lib.cpp \
releng/codesamples/api_xorriso.cpp \
releng/inc/releng_getopts.inc \
releng/jigdo-gen-md5-list \
releng/jigdo-gen-md5-list.1 \
releng/manual_burn \
releng/manual_devices \
releng/manual_isojigdo \
releng/releng_generated_data/placeholder \
releng/run_all_auto \
releng/template_new \
$(man_MANS)

View File

@ -0,0 +1,324 @@
------------------------------------------------------------------------------
http:libburnia-project.org
------------------------------------------------------------------------------
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-1.4.4.tar.gz
Copyright (C) 2006-2009 Vreixo Formoso,
Copyright (C) 2006-2016 Thomas Schmitt.
Provided under GPL version 2 or later.
------------------------------------------------------------------------------
libisoburn is a frontend for libraries libburn and libisofs which enables
creation and expansion of ISO-9660 filesystems on all CD/DVD/BD media supported
by libburn. This includes media like DVD+RW, which do not support multi-session
management on media level and even plain disk files or block devices.
The price for that is thorough specialization on data files in ISO-9660
filesystem images. So libisoburn is not suitable for audio (CD-DA) or any
other CD layout which does not entirely consist of ISO-9660 sessions.
xorriso is an application of libisoburn, libisofs, and libburn, which reads
commands from program arguments, files, stdin, or readline.
Its features are also available via a C language API of libisoburn.
Currently they are fully supported on Linux with kernels >= 2.4,
on FreeBSD with ATAPI/CAM support enabled in the kernel, see atapicam(4),
on OpenSolaris (tested with kernel 5.11),
on NetBSD (tested with 6.1.2 and 6.1.3).
On other X/Open compliant systems libburn will only offer POSIX i/o with disk
file objects, but no direct MMC operation on CD/DVD/BD drives.
By using this software you agree to the disclaimer at the end of this text:
"... without even the implied warranty ..."
Compilation, First Glimpse, Installation
Dynamic library and compile time header requirements for libisoburn-1.4.4 :
- libburn.so.4 , version libburn-1.4.4 or higher
- libisofs.so.6 , version libisofs-1.4.4 or higher
libisoburn and xorriso will not start with libraries which are older than their
include headers seen at compile time.
Obtain libisoburn-1.4.4.tar.gz, take it to a directory of your choice
and do:
tar xzf libisoburn-1.4.4.tar.gz
cd libisoburn-1.4.4
Within that directory execute:
./configure --prefix=/usr
make
Then become superuser and execute
make install
which will make available libisoburn.so.1 and the program xorriso.
On GNU/Linux it will try to run program ldconfig with the library installation
directory as only argument. Failure to do so will not abort installation.
One may disable ldconfig by ./configure option --disable-ldconfig-at-install .
By use of a version script, the libisoburn.so library exposes no other function
names but those of the API definitions in <libisoburn/libisoburn.h> and
<libisoburn/xorriso.h>.
If -Wl,--version-script=... makes problems with the local compiler, then
disable this encapsulation feature by
./configure --disable-versioned-libs
make clean ; make
The ./configure script of libisoburn can check via pkg-config whether suitable
libburn and libisoburn are installed. Regrettably this test failed on several
systems due to local pkg-config problems. So it is disabled by default and may
be enabled by:
./configure --enable-pkg-check-modules
In this case, ./configure fails if no suitable installations are found.
xorriso
libisoburn comes with a command line and dialog application named xorriso,
which offers a substantial part of libisoburn features to shell scripts and
users. Its file xorriso/README_gnu_xorriso describes the tarball of the
derived package GNU xorriso as first preference for a statically linked
xorriso installation.
The libisoburn installation described above produces a dynamically linked
xorriso binary depending on libburn.so, libisofs.so, libisoburn.so.
After installation documentation is available via
man xorriso
man xorrisofs
man xorrecord
Several alias links point to the xorriso binary:
xorrisofs starts xorriso with -as mkisofs emulation already enabled
xorrecord starts xorriso with -as cdrecord emulation already enabled
osirrox starts with -osirrox image-to-disk copying already enabled
By default libisoburn will depend on libreadline if the library and its
development header files are present at compile time. If not, then it will
try to depend on libedit and its header file.
Both conditional dependencies can be avoided by running
./configure --prefix=/usr --disable-libreadline
make clean ; make
Never omit the "make clean" command after switching enabling of libreadline.
Note that depending on libreadline-6 will cause libisoburn's license to
become "GPL version 3 or later".
If you want to explictely allow only the use of libedit, then do
./configure --prefix=/usr --disable-libreadline --enable-libedit
Other deliberate dependency reduction options of ./configure are:
--disable-libacl avoid use of ACL functions like acl_to_text()
--disable-xattr avoid use of xattr functions like listxattr() on Linux
or extattr_list_file() on FreeBSD
--disable-zlib avoid use of zlib functions like compress2()
--disable-libjte avoid use of libjte for -jigdo command
xorriso allows to use external processes as file content filters. This is
a potential security risk which may be avoided by ./configure option
--disable-external-filters
By default the filter feature is disabled if effective user id and real
user id differ. This ban can be lifted by
--enable-external-filters-setuid
In some situations Linux may deliver a better write performance to DVD drives
if 64 KB rather than 32 KB are transmitted in each write operation.
64k can be made default at configure time by:
--enable-dvd-obs-64k
libisoburn, libisofs, and libburn C language API
For the lower API concepts and calls see
./libisoburn/libisoburn.h
as well as
/usr/include/libisofs/libisofs.h
/usr/include/libburn/libburn.h
xorriso C language API
Actually the dynamically linked xorriso binary is only a small start program
for the xorriso API that is implemented inside libisoburn.
There are API calls for command readers and interpreters, and there are
API calls for each single command of xorriso.
Interested programmers should have a look into the API definition at
xorriso/xorriso.h
and the start program
xorriso/xorriso_main.c
The header file xorriso.h gets installed suitable for
#include <libisoburn/xorriso.h>
So after installation of a binary libisoburn package you may find it e.g. as
/usr/include/libisoburn/xorriso.h
xorriso under control of a (GUI) frontend process
The dialog mode allows frontend programs to connect via pipes to the standard
input and output of xorriso. Several commands of xorriso help with receiving
and parsing of reply messages.
As a proof of concept, there is the Tcl/Tk script xorriso-tcltk which can
be launched by this shell command:
xorriso-tcltk
Or in the xorriso build directory, without installation of xorriso:
xorriso/xorriso -launch_frontend frontend/xorriso-tcltk --stdio --
In the running GUI, click with the rightmost mouse button on any GUI element
to get its particular help text. The "Help" button at the upper right corner
gives a short introduction and instructions for some common use cases.
See also file frontend/README-tcltk.
See its Tcl code for getting an idea how this gets achieved.
The script is part of the tarball and gets installed by make install. If a
xorriso distro package does not install it, you may get it directly from
http://libburnia-project.org/export/head/libisoburn/trunk/frontend/xorriso-tcltk
Further there is the C program frontend/frontend_pipes_xorriso.c which
forks a xorriso process and shows similar communication gestures as
xorriso-tcltk.
In particular it connects to xorriso via two pipes, sends commands, waits
for all replies of a command, picks info out of the xorriso message sieve,
and parses reply message lines into words.
The bash script frontend/sh_on_named_pipes.sh forks a xorriso process
connected to two pipes. It then runs a dialog loop, sends commands to xorriso,
and displays the replies.
The sh script frontend/xorriso_broker.sh is intended to execute xorriso
commands on a permanently running xorriso process.
It gets an id_string by which it looks for named pipes with a running xorriso
process. If no such pipe is found, then it starts a xorriso connected to
newly created pipes.
After this is done, the optionally given xorriso arguments are written into
the stdin pipe from where xorriso will read and execute them. The script will
end but the xorriso process will go on and wait for more commands.
Drives and Disk File Objects
The user of libisoburn applications needs operating system dependent
permissions for the CD/DVD/BD drives which shall be used.
On Linux, FreeBSD, NetBSD this means -rw-permissions, even if only reading is
intended. On Solaris one needs privileges "basic,sys_devices" and r-permission,
even if writing is intended.
A list of rw-accessible drives can be obtained by
xorriso -devices
or by xorriso API call
Xorriso_option_devices()
or by libburn API call
burn_drive_scan()
A possible source of problems are hald or other automounters.
If you can spot a process "hald-addon-storage" with the address of
your desired drive, then consider to kill it.
A similar process "udisks-daemon: polling ..." can be seen on newer Linuxes.
On Debian GNU/Linux 6.0.2 amd64 there is
/lib/udev/rules.d/80-udisks.rules
where one can remove all CD drives ("sr*") from the list of automountable
devices:
KERNEL=="sd*|hd*|mmcblk*|mspblk*", ENV{UDISKS_PRESENTATION_NOPOLICY}="0"
# KERNEL=="sd*|hd*|sr*|mmcblk*|mspblk*", ENV{UDISKS_PRESENTATION_NOPOLICY}="0"
Copying the recognition criterion from
/etc/udev/rules.d/70-persistent-cd.rules
one can prevent automounting a single drive, too. E.g.:
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-2:0:0:0", ENV{UDISKS_PRESENTATION_NOPOLICY}:="1"
If you cannot get rid of the automounter, try whether it helps to always load
the drive tray manually before starting a write run of xorriso. Wait until the
drive light is off and the mounted media appears.
Then try to unmount the mounted media before a write run.
Besides true optical drives, libisoburn can also address disk files as input or
output drives. The addresses of the disk files have to be preceded by "stdio:".
Like:
"stdio:/tmp/pseudo_drive"
Note: xorriso by default prefixes "stdio:" to addresses outside the /dev tree
if they do not lead to an optical drive device file.
Testing
For automated and manual tests of xorriso's functionality see file
releng/README.
Result comparison with self produced ISO images
We are quite sure that libisofs produces accurate representations of the disk
files. This opinion is founded on a lot of test burns and checks by a little
test program which compares files from the mounted image with the orignals
on disk. It uses the normal POSIX filesystem calls, i.e. no libburnia stuff.
This program is not installed systemwide but stays in the installation
directory of the libisoburn tarball as test/compare_file . Usually it is
run as -exec payload of a find command. It demands at least three arguments:
The path of the file to compare, the prefix1 to be cut off from path
and the prefix2 which gets prepended afterwards to obtain the path of the
second file to compare.
As further argument there can be -no_ctime which suppresses the comparison
of ctime date stamps.
The exit value is 0 if no difference was detected, non-0 else.
Example: After
xorriso ... -pathspecs on -add /=/original/dir --
mount /media/dvd
cd test
compare tree /media/dvd with tree /original/dir :
find /original/dir -exec ./compare_file '{}' /original/dir /media/dvd ';' \
| less
and vice versa:
find /media/dvd -exec ./compare_file '{}' /media/dvd /original/dir ';' \
| less
------------------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 or later
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
------------------------------------------------------------------------------
Based on and sub project of:
libburnia-project.org
By Mario Danic <mario.danic@gmail.com>,
Vreixo Formoso <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Copyright (C) 2006-2015 Mario Danic, Vreixo Formoso, Thomas Schmitt.
We will not raise any legal protest to dynamic linking of our libraries
with applications that are not under GPL, as long as they fulfill
the condition of offering the library source code used, whether
altered or unaltered, under the GPLv2+, along with the application.
Nevertheless, the safest legal position is not to link libburn with
non-GPL compatible programs.
libburnia-project.org is inspired by and in other components still containing
parts of old
Libburn. By Derek Foreman <derek@signalmarketing.com> and
Ben Jansens <xor@orodu.net>
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
libisoburn does not stem from their code.

View File

@ -0,0 +1,11 @@
[Task] Figure out how to use "Requires" in pc.in (libisoburn and libisofs would benefit)
[Task] Figure out the usage of Libs.private (used in libburn)
[Task] Improve build system
[Task] Investigate build system, so other libburnia components can benefit
[Task] Write Doxygen files
[Task] Explain to Thomas & Vreixo about NEWS importance (all libburnia components
will benefit
[Task] Write a document about ABI & API
[Task] Create following targets for make: Src, Indent, Docs, Test, All [Any other suggestions?)
All those tasks are currently assigned to Mario.

View File

@ -0,0 +1,378 @@
AC_DEFUN([LIBBURNIA_SET_FLAGS],
[
case $target_os in
freebsd*)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
;;
netbsd*)
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/pkg/lib"
CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/pkg/include"
;;
solaris*)
LDFLAGS="$LDFLAGS -L/usr/local/lib"
esac
])
AC_DEFUN([TARGET_SHIZZLE],
[
ARCH=""
LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
AC_MSG_CHECKING([target operating system])
LIBBURNIA_SUPP_ACL=none
LIBBURNIA_SUPP_FATTR=none
LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
case $target in
*-*-linux*)
ARCH=linux
LIBBURN_ARCH_LIBS=
LIBBURNIA_SUPP_ACL=libacl
LIBBURNIA_SUPP_FATTR=xattr
LIBBURNIA_LDCONFIG_CMD=ldconfig
;;
*-*-freebsd*)
ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam
LIBBURNIA_SUPP_ACL=libacl
LIBBURNIA_SUPP_FATTR=extattr
# This may later be overridden by configure --enable-libdir-pkgconfig
LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
;;
*-kfreebsd*-gnu*)
ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam
;;
*-solaris*)
ARCH=solaris
LIBBURN_ARCH_LIBS=-lvolmgt
;;
*)
ARCH=
LIBBURN_ARCH_LIBS=
# AC_ERROR([You are attempting to compile for an unsupported platform])
;;
esac
AC_MSG_RESULT([$ARCH])
])
dnl LIBBURNIA_CHECK_ICONV is by Thomas Schmitt, libburnia project
dnl It is based on gestures from:
dnl iconv.m4 serial AM7 (gettext-0.18)
dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl
AC_DEFUN([LIBBURNIA_CHECK_ICONV],
[
dnl Check whether it is allowed to link with -liconv
AC_MSG_CHECKING([for iconv() in separate -liconv ])
libburnia_liconv="no"
libburnia_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
[libburnia_liconv="yes"],
[LIBS="$libburnia_save_LIBS"]
)
AC_MSG_RESULT([$libburnia_liconv])
if test x"$libburnia_save_LIBS" = x"$LIBS"
then
dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
dnl It is not tested whether this is detected by above macro.
AC_CHECK_LIB(iconv, libiconv, , )
fi
dnl Check for iconv(..., const char **inbuf, ...)
AC_MSG_CHECKING([for const qualifier with iconv() ])
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
], [], [libburnia_iconv_const=""], [libburnia_iconv_const="const"]
)
if test x$libburnia_iconv_const = xconst
then
AC_DEFINE_UNQUOTED([ICONV_CONST], [const])
else
AC_DEFINE_UNQUOTED([ICONV_CONST], [])
fi
test -z "$libburnia_iconv_const" && libburnia_iconv_const="no"
AC_MSG_RESULT([$libburnia_iconv_const])
])
dnl LIBBURNIA_ASSERT_ICONV is by Thomas Schmitt, libburnia project
dnl
AC_DEFUN([LIBBURNIA_ASSERT_ICONV],
[
if test x$XORRISO_ASSUME_ICONV = x
then
dnl Check for the essential gestures of libisofs/util.c
AC_MSG_CHECKING([for iconv() to be accessible now ])
AC_TRY_LINK([
#include <stdlib.h>
#include <wchar.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <stdio.h>
#include <limits.h>
#include <iconv.h>
#include <locale.h>
#include <langinfo.h>
#include <unistd.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);
], [iconv_test="yes"], [iconv_test="no"]
)
AC_MSG_RESULT([$iconv_test])
if test x$iconv_test = xno
then
echo >&2
echo "Cannot get function iconv() to work. Configuration aborted." >&2
echo "Check whether your system needs a separate libiconv installed." >&2
echo "If it is installed but not found, try something like" >&2
echo ' export LDFLAGS="$LDFLAGS -L/usr/local/lib"' >&2
echo ' export CPPFLAGS="$CPPFLAGS -I/usr/local/include"' >&2
echo ' export LIBS="$LIBS -liconv"' >&2
echo "You may override this test by exporting variable" >&2
echo " XORRISO_ASSUME_ICONV=yes" >&2
echo >&2
(exit 1); exit 1;
fi
fi
])
dnl LIBBURNIA_TRY_EDITLINE is by Thomas Schmitt, libburnia project
dnl It performs the actual test compilation for editline.
dnl Variable LIBS has to be set by the caller.
AC_DEFUN([LIBBURNIA_TRY_EDITLINE],
[
AC_TRY_LINK([
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <histedit.h>],
[EditLine *editline_handle; History *editline_history; HistEvent ev; int count;
editline_handle= el_init("dummy", stdin, stdout, stderr);
el_set(editline_handle, EL_EDITOR, "emacs");
editline_history= history_init();
history(editline_history, &ev, H_SETSIZE, 1000);
el_gets(editline_handle, &count);
], [editline_test="yes"], [editline_test="no"]
)
])
dnl LIBBURNIA_ASSERT_EDITLINE is by Thomas Schmitt, libburnia project
dnl It disables xorriso editline if not all needed functions are present
AC_DEFUN([LIBBURNIA_ASSERT_EDITLINE],
[
if test x$XORRISO_ASSUME_EDITLINE = x
then
dnl Check for the essential gestures of xorriso/text_io.c
AC_MSG_CHECKING([for desired functions in libedit])
libburnia_save_LIBS="$LIBS"
LIBS="$LIBS -ledit"
LIBBURNIA_TRY_EDITLINE
if test x$editline_test = xno
then
LIBS="$libburnia_save_LIBS"
LIBS="$LIBS -ledit"
LIBBURNIA_TRY_EDITLINE
fi
if test x$editline_test = xno
then
READLINE_DEF=
LIBS="$libburnia_save_LIBS"
fi
AC_MSG_RESULT([$editline_test $editline_msg])
fi
])
dnl LIBBURNIA_TRY_READLINE is by Thomas Schmitt, libburnia project
dnl It performs the actual test compilation for readline.
dnl Variable LIBS has to be set by the caller.
AC_DEFUN([LIBBURNIA_TRY_READLINE],
[
AC_TRY_LINK([
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <readline/readline.h>
#include <readline/history.h>],
[HIST_ENTRY **hl;
readline("");
add_history("");
hl= history_list();
], [readline_test="yes"], [readline_test="no"]
)
])
dnl LIBBURNIA_ASSERT_READLINE is by Thomas Schmitt, libburnia project
dnl It disables xorriso readline if not all needed functions are present
AC_DEFUN([LIBBURNIA_ASSERT_READLINE],
[
if test x$XORRISO_ASSUME_READLINE = x
then
dnl Check for the essential gestures of xorriso/text_io.c
AC_MSG_CHECKING([for desired functions in libreadline])
readline_msg=
libburnia_save_LIBS="$LIBS"
LIBS="$LIBS -lreadline"
LIBBURNIA_TRY_READLINE
if test x$readline_test = xno
then
LIBS="$libburnia_save_LIBS"
LIBS="$LIBS -lreadline -lcurses"
LIBBURNIA_TRY_READLINE
if test x$readline_test = xyes
then
readline_msg=", with -lcurses"
fi
fi
if test x$readline_test = xno
then
READLINE_DEF=
LIBS="$libburnia_save_LIBS"
fi
AC_MSG_RESULT([$readline_test $readline_msg])
fi
])
dnl LIBISOBURN_ASSERT_VERS_LIBS is by Thomas Schmitt, libburnia project
dnl It tests whether -Wl,--version-script=... works with the compiler
AC_DEFUN([LIBISOBURN_ASSERT_VERS_LIBS],
[
libburnia_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script=libisoburn/libisoburn.ver"
AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
[vers_libs_test="yes"], [vers_libs_test="no"])
if test x$vers_libs_test = xyes
then
LIBLDFLAGS="-Wl,--version-script=libisoburn/libisoburn.ver"
fi
LDFLAGS="$libburnia_save_LDFLAGS"
AC_SUBST(LIBLDFLAGS)
])
dnl LIBBURNIA_SET_PKGCONFIG is by Thomas Schmitt, libburnia project
dnl It determines the install directory for the *.pc file.
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
AC_DEFUN([LIBBURNIA_SET_PKGCONFIG],
[
### for testing --enable-libdir-pkgconfig on Linux
### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig
if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig
then
dummy=dummy
else
AC_ARG_ENABLE(libdir-pkgconfig,
[ --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no],
, enable_libdir_pkgconfig="no")
AC_MSG_CHECKING([for --enable-libdir-pkgconfig])
if test "x$enable_libdir_pkgconfig" = xyes
then
LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
fi
AC_MSG_RESULT([$enable_libdir_pkgconfig])
fi
libburnia_pkgconfig_override="no"
AC_ARG_ENABLE(pkgconfig-path,
[ --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc],
libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none")
AC_MSG_CHECKING([for overridden pkgconfig directory path])
if test "x$enable_pkgconfig_path" = xno
then
libburnia_pkgconfig_override="no"
fi
if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes
then
libburnia_pkgconfig_override="invalid argument"
fi
if test "x$libburnia_pkgconfig_override" = xyes
then
LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path"
AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR])
else
AC_MSG_RESULT([$libburnia_pkgconfig_override])
fi
AC_SUBST(LIBBURNIA_PKGCONFDIR)
dnl For debugging only
### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR])
])
dnl LIBBURNIA_TRY_TIMEZONE is by Thomas Schmitt, libburnia project
dnl It tests whether the global variable exists and is suitable for
dnl integer arithmetics.
AC_DEFUN([LIBBURNIA_TRY_TIMEZONE],
[
echo -n "checking for timezone variable ... "
AC_TRY_LINK([ #include <time.h> ], [long int i; i = 1 - timezone; ],
[LIBBURNIA_TIMEZONE="timezone"], [LIBBURNIA_TIMEZONE="0"]
)
echo "$LIBBURNIA_TIMEZONE"
])
dnl LIBBURNIA_CHECK_ARCH_LIBS is by Thomas Schmitt, libburnia project
dnl It tests whether the OS dependent libraries are available.
dnl With libisoburn they are needed only for the case that indirect linking
dnl does not work. So it is worth a try to omit them.
dnl $1 = "mandatory" or "optional" define the action if test linking fails.
AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
[
libburnia_save_LIBS="$LIBS"
if test "x$LIBBURN_ARCH_LIBS" = x
then
dummy=dummy
else
LIBS="$LIBS $LIBBURN_ARCH_LIBS"
AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
[archlibs_test="yes"], [archlibs_test="no"])
LIBS="$libburnia_save_LIBS"
if test x$archlibs_test = xno
then
if test x"$1" = xmandatory
then
echo >&2
echo "FATAL: Test linking with mandatory library options failed: $LIBBURN_ARCH_LIBS" >&2
echo >&2
(exit 1); exit 1;
else
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
LIBBURN_ARCH_LIBS=""
fi
else
echo "enabled linking with $LIBBURN_ARCH_LIBS"
fi
fi
])

View File

@ -0,0 +1,11 @@
#!/bin/sh -x
aclocal -I .
libtoolize --copy --force
autoconf
# Not with libisoburn
# autoheader
automake --foreign --add-missing --copy --include-deps

View File

@ -0,0 +1,495 @@
AC_INIT([libisoburn], [1.4.5], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
LIBBURNIA_SET_FLAGS
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([./])
dnl Hint: Search list for version code aspects:
dnl /AC_INIT(
dnl /ISOBURN_.*_VERSION
dnl /LT_.*
dnl /LIB.*_REQUIRED
dnl The API version codes are defined in libisoburn/libisoburn.h
dnl #define isoburn_header_version_*
dnl configure.ac only rules the libtool revision numbering about
dnl LT_CURREN, LT_AGE, LT_REVISION where SONAME becomes LT_CURRENT - LT_AGE
dnl
dnl These three are only copies to provide libtool with unused LT_RELEASE
ISOBURN_MAJOR_VERSION=1
ISOBURN_MINOR_VERSION=4
ISOBURN_MICRO_VERSION=5
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
AC_SUBST(ISOBURN_MAJOR_VERSION)
AC_SUBST(ISOBURN_MINOR_VERSION)
AC_SUBST(ISOBURN_MICRO_VERSION)
dnl AC_SUBST(ISOBURN_VERSION)
dnl Libtool versioning
dnl Generate libisoburn.so.1.x.y
dnl SONAME will become LT_CURRENT - LT_AGE
dnl
dnl ts B60701
dnl (By mistake, 1.4.4 got LT_CURRENT/LT_AGE=101/100 rather than 102/102)
dnl ### This is the release version 1.4.4 = libisoburn.so.1.100.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 = 101 - 100 = 1 . Library name = libisoburn.so.1.100.0
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
LT_CURRENT=101
LT_AGE=100
LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)
AC_PREFIX_DEFAULT([/usr/local])
test "$prefix" = "NONE" && prefix=$ac_default_prefix
AM_MAINTAINER_MODE
AM_PROG_CC_C_O
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
dnl Large file support
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNC([fseeko])
if test ! $ac_cv_func_fseeko; then
AC_ERROR([Libburn requires largefile support.])
fi
if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x
then
dnl ts B00410 : To detect the need for -liconv and const argument of iconv()
LIBBURNIA_CHECK_ICONV
else
dnl Outdated: produces double -liconv and warnings about parameter mismatch
dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
dnl If not, then no -liconv will be added.
AC_CHECK_LIB(iconv, iconv, , )
dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
AC_CHECK_LIB(iconv, libiconv, , )
fi
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
# LIBTOOL="$LIBTOOL --silent"
AC_PROG_INSTALL
AC_CHECK_HEADERS()
dnl Check for tm_gmtoff field in struct tm
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
[AC_DEFINE(HAVE_TM_GMTOFF, 1,
[Define this if tm structure includes a tm_gmtoff entry.])],
,
[#include <time.h>])
dnl Whether timezone is an integer variable
AH_TEMPLATE([Libburnia_timezonE], [Either timezone or 0])
LIBBURNIA_TRY_TIMEZONE
if test x$LIBBURNIA_TIMEZONE = xtimezone
then
AC_DEFINE([Libburnia_timezonE], [timezone])
else
AC_DEFINE([Libburnia_timezonE], [0])
fi
THREAD_LIBS=-lpthread
AC_SUBST(THREAD_LIBS)
TARGET_SHIZZLE
AC_SUBST(ARCH)
AC_SUBST(LIBBURNIA_PKGCONFDIR)
AC_SUBST(LIBBURN_ARCH_LIBS)
# Do not link libcam or libvolmgt if not available.
# (They are indirect dependency on FreeBSD or Solaris.)
LIBBURNIA_CHECK_ARCH_LIBS(optional)
dnl Determine target directory for libisoburn-*.pc
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
LIBBURNIA_SET_PKGCONFIG
AC_ARG_ENABLE(libreadline,
[ --enable-libreadline Enable use of libreadline by xorriso, default=yes],
, enable_libreadline=yes)
if test x$enable_libreadline = xyes; then
dnl Check whether there is readline-devel and readline-runtime.
dnl If not, erase this macro which would enable use of readline(),add_history()
READLINE_DEF="-DXorriso_with_readlinE"
if test x$XORRISO_OLD_READLINE_CONFIGURE = x
then
dnl ts B00411 : To disable readline if not all needed functions are present
LIBBURNIA_ASSERT_READLINE
else
dnl The empty yes case obviously causes -lreadline to be linked
AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
dnl The X= in the yes case prevents that -lreadline gets linked twice
AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
fi
else
READLINE_DEF=
echo "disabled libreadline"
fi
if test x$READLINE_DEF = x; then
if test x$enable_libreadline = xyes; then
libedit_deflt=yes
else
libedit_deflt=no
fi
AC_ARG_ENABLE(libedit,
[ --enable-libedit Enable use of libedit by xorriso if not libreadline,
default= setting of --enable-libreadline],
, enable_libedit=$libedit_deflt)
if test x$enable_libedit = xyes; then
READLINE_DEF="-DXorriso_with_editlinE"
LIBBURNIA_ASSERT_EDITLINE
else
READLINE_DEF=
echo "disabled libedit"
fi
fi
AC_SUBST(READLINE_DEF)
dnl ts A90329
dnl ACL and xattr do not need to be enabled in libisoburn or xorriso source
dnl but without AC_CHECK_LIB() xorriso will not be linked with -lacl .
dnl On my Linux this does work with an ACL enabled libisofs but in general
dnl it seems not be right.
dnl So for now it seems to be best to do the same configuration for libisoburn
dnl and xorriso as for libisofs.
AC_ARG_ENABLE(libacl,
[ --enable-libacl Enable use of libacl by libisofs, default=yes],
, enable_libacl=yes)
LIBACL_DEF=
if test x$LIBBURNIA_SUPP_ACL = xlibacl
then
if test x$enable_libacl = xyes; then
dnl Check whether there is libacl-devel and libacl-runtime.
dnl If not, erase this macro which would enable use of acl_to_text and others
LIBACL_DEF="-DLibisofs_with_aaip_acL"
dnl The empty yes case obviously causes -lacl to be linked
has_acl_h_but_no_func=0
AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= )
if test "$has_acl_h_but_no_libacl" = 1
then
AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
fi
fi
fi
if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL
then
if test x$has_acl_h_but_no_libacl = x1
then
echo "enabled local processing of ACL"
else
echo "enabled libacl, local processing of ACL"
fi
else
echo "disabled local processing of ACL"
fi
AC_SUBST(LIBACL_DEF)
AC_ARG_ENABLE(xattr,
[ --enable-xattr Enable use of extended file attributes by libisofs, default=yes],
, enable_xattr=yes)
XATTR_DEF=
if test x"$LIBBURNIA_SUPP_FATTR" = xxattr
then
if test "x$enable_xattr" = xyes; then
dnl Check whether there is the header for Linux xattr.
dnl If not, erase this macro which would enable use of listxattr and others
XATTR_DEF="-DLibisofs_with_aaip_xattR"
AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
XATTR_DEF= ), XATTR_DEF= )
fi
elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr
then
if test "x$enable_xattr" = xyes; then
XATTR_DEF="-DLibisofs_with_freebsd_extattR"
AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=,
XATTR_DEF= ), XATTR_DEF= )
fi
fi
if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR
then
echo "enabled xattr, local processing of extended file attributes Linux style"
elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR
then
echo "enabled extattr, local processing of extended file attributes FreeBSD style"
else
echo "disabled local processing of extended file attributes"
fi
AC_SUBST(XATTR_DEF)
dnl ts A90409
dnl Same situation as with xattr and ACL: libisoburn does not depend directly
dnl on zlib. But if it is enabled in libisofs then it seems wise to link it
dnl with libisoburn apps.
AC_ARG_ENABLE(zlib,
[ --enable-zlib Enable use of zlib by libisofs, default=yes],
, enable_zlib=yes)
if test x$enable_zlib = xyes; then
dnl Check whether there is the header for zlib.
dnl If not, erase this macro which would enable use of compress2() and others.
dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks
dnl compressBound(). So compressBound is the more modern thing to test.
dnl The empty parameter after "compressBound" causes -lz.
ZLIB_DEF="-DLibisofs_with_zliB"
AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
else
ZLIB_DEF=
fi
AC_SUBST(ZLIB_DEF)
dnl ts B00928
AC_ARG_ENABLE(libjte,
[ --enable-libjte Enable use of libjte by xorriso, default=yes],
, enable_libjte=yes)
if test "x$enable_libjte" = xyes; then
LIBJTE_DEF="-DXorriso_with_libjtE"
AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
else
LIBJTE_DEF=
fi
AC_SUBST(LIBJTE_DEF)
dnl ts B00107
dnl Just for the case that it is necessary to give link option -lcdio not only
dnl with libburn but also with libburn apps like xorriso.
dnl On SuSE 10.2 this is not needed. libburn finds libcdio on its own.
case $host_os in
cygwin*|mingw*)
default_libcdio=yes
;;
*)
default_libcdio=no
;;
esac
AC_ARG_ENABLE(libcdio,
[ --enable-libcdio Enable use of libcdio as system adapter, default=no (except on MSWindows)],
, enable_libcdio=$default_libcdio)
if test x$enable_libcdio = xyes; then
dnl Check whether there is libcdio-devel and libcdio-runtime.
dnl If not, erase this macro
LIBCDIO_DEF="-DLibburn_use_libcdiO"
dnl The empty yes case obviously causes -lcdio to be linked
AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= )
else
LIBCDIO_DEF=
fi
if test x$LIBCDIO_DEF = x
then
if test x$enable_libcdio = xyes
then
echo "WARNING: could not enable use of libcdio as system adapter"
fi
else
echo "enabled use of libcdio as system adapter"
fi
AC_SUBST(LIBCDIO_DEF)
AC_ARG_ENABLE(external-filters,
[ --enable-external-filters Enable use of external filter programs by xorriso, default=yes],
, enable_external_filters=yes)
if test x"$enable_external_filters" = xyes; then
EXTF_DEF="-DXorriso_allow_external_filterS"
echo "enabled xorriso external filter programs"
else
EXTF_DEF=
echo "disabled xorriso external filter programs"
fi
AC_SUBST(EXTF_DEF)
AC_ARG_ENABLE(external-filters-setuid,
[ --enable-external-filters-setuid Enable xorriso external filter programs under setuid, default=no],
, enable_external_filters_setuid=no)
if test x$enable_external_filters_setuid = xyes; then
EXTF_SUID_DEF="-DXorriso_allow_extf_suiD"
echo "enabled xorriso external filter programs under setuid"
else
EXTF_SUID_DEF=
echo "disabled xorriso external filter programs under setuid"
fi
AC_SUBST(EXTF_SUID_DEF)
AC_ARG_ENABLE(launch-frontend,
[ --enable-launch-frontend Enable start of piped frontend program by xorriso, default=yes],
, enable_launch_frontend=yes)
if test x"$enable_launch_frontend" = xyes; then
LFRONT_DEF="-DXorriso_allow_launch_frontenD"
echo "enabled xorriso command -launch_frontend"
else
LFRONT_DEF=
echo "disabled xorriso command -launch_frontend"
fi
AC_SUBST(LFRONT_DEF)
AC_ARG_ENABLE(launch-frontend-setuid,
[ --enable-launch-frontend-setuid Enable start of piped frontend program under setuid, default=no],
, enable_launch_frontend_setuid=no)
if test x$enable_launch_frontend_setuid = xyes; then
LFRONT_SUID_DEF="-DXorriso_allow_extf_suiD"
echo "enabled xorriso command -launch_frontend under setuid"
else
LFRONT_SUID_DEF=
echo "disabled xorriso command -launch_frontend under setuid"
fi
AC_SUBST(LFRONT_SUID_DEF)
AC_ARG_ENABLE(dvd-obs-64k,
[ --enable-dvd-obs-64k 64 KB default size for xorriso DVD writing, default=no],
, enable_dvd_obs_64=no)
if test x$enable_dvd_obs_64k = xyes; then
XORRISO_DVD_OBS_64K="-DXorriso_dvd_obs_default_64K"
echo "enabled xorriso write size default 64 KB on DVD"
else
XORRISO_DVD_OBS_64K=
echo "disabled xorriso write size default 64 KB on DVD"
fi
AC_SUBST(XORRISO_DVD_OBS_64K)
# Library versioning normally serves a complex purpose.
# Since libisoburn obeys strict ABI backward compatibility, it needs only the
# simple feature to declare function names "global:" or "local:". Only the
# global ones are visible to applications at library load time.
AC_ARG_ENABLE(versioned-libs,
[ --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
, enable_versioned_libs=yes)
if test x$enable_versioned_libs = xyes; then
vers_libs_test=no
LIBISOBURN_ASSERT_VERS_LIBS
if test x$vers_libs_test = xno
then
echo "disabled strict symbol encapsulation (test failed)"
else
echo "enabled strict symbol encapsulation"
fi
else
echo "disabled strict symbol encapsulation"
fi
AC_ARG_ENABLE(ldconfig-at-install,
[ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes],
, ldconfig_at_install=yes)
if test x$ldconfig_at_install = xyes; then
dummy=dummy
else
LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
echo "disabled run of ldconfig during installation on GNU/Linux"
fi
AC_SUBST(LIBBURNIA_LDCONFIG_CMD)
AC_CHECK_HEADER(libburn/libburn.h, LIBBURNIA_HAVE_LIBBURN=1, LIBBURNIA_HAVE_LIBBURN=0)
AC_CHECK_HEADER(libisofs/libisofs.h, LIBBURNIA_HAVE_LIBISOFS=1, LIBBURNIA_HAVE_LIBISOFS=0)
if test x$LIBBURNIA_HAVE_LIBBURN = x0; then
echo "FATAL: Lacking libburn development header file <libburn/libburn.h>" 2>&1
echo "HINT: You first have to install libburn before you can build libisoburn" 2>&1
fi
if test x$LIBBURNIA_HAVE_LIBISOFS = x0; then
echo "FATAL: Lacking libisofs development header file <libisofs/libisofs.h>" 2>&1
echo "HINT: You first have to install libisofs before you can build libisoburn" 2>&1
fi
if test x$LIBBURNIA_HAVE_LIBBURN = x0 -o x$LIBBURNIA_HAVE_LIBISOFS = x0; then
echo "ABORT: Lacking mandatory prerequisites" 2>&1
exit 1
fi
# ------- Visible mark in configure : Start of library check
# Check for proper library versions if this is desired.
# (It fails too often on too many systems.)
AC_ARG_ENABLE(pkg-check-modules,
[ --enable-pkg-check-modules Enable pkg-config check for libburn and libisofs , default=no],
, enable_pkg_check_modules=no)
if test x$enable_pkg_check_modules = xyes; then
dnl If PKG_CHECK_MODULES is to be used after this if-block,
dnl then it might be necessary to perform PKG_PROG_PKG_CONFIG before the block.
LIBBURN_REQUIRED=1.4.4
LIBISOFS_REQUIRED=1.4.4
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
if test x$LIBCDIO_DEF = x; then
dummy=dummy
else
LIBCDIO_REQUIRED=0.83
PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
fi
else
echo "checking for LIBBURN... skipped, no --enable-pkg-check-modules"
echo "checking for LIBISOFS... skipped, no --enable-pkg-check-modules"
if test x$LIBCDIO_DEF = x; then
dummy=dummy
else
echo "checking for LIBCDIO... skipped, no --enable-pkg-check-modules"
fi
fi
# ------- Visible mark in configure : End of library check
dnl Add compiler-specific flags
dnl See if the user wants aggressive optimizations of the code
AC_ARG_ENABLE(debug,
[ --enable-debug Disable aggressive optimizations [default=yes]],
, enable_debug=yes)
if test x$enable_debug != xyes; then
if test x$GCC = xyes; then
CFLAGS="-O3 $CFLAGS"
CFLAGS="-fexpensive-optimizations $CFLAGS"
fi
CFLAGS="-DNDEBUG $CFLAGS"
else
if test x$GCC = xyes; then
CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
fi
CFLAGS="-DDEBUG $CFLAGS"
fi
CFLAGS="$READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $LFRONT_DEF $LFRONT_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K $CFLAGS"
AC_CONFIG_FILES([
Makefile
doc/doxygen.conf
version.h
libisoburn-1.pc
])
AC_OUTPUT

View File

@ -0,0 +1,85 @@
/**
@author Mario Danic, Vreixo Formoso, Thomas Schmitt
@mainpage Libisoburn Documentation Index
@section intro Introduction
Libburnia is an open-source project for reading, mastering and writing
optical discs. This page is about its capability to read, manipulate, and
write ISO 9660 filesystems with Rock Ridge extensions. Media can be optical
media or filesystem objects.
Our scope is currently Linux 2.4 and 2.6, FreeBSD, OpenSolaris, or NetBSD.
libisoburn is an add-on to libburn and libisofs which coordinates both and
also allows to grow ISO-9660 filesystem images on multi-session media as well
as on overwriteable media via the same API.
All media peculiarities are handled automatically.
xorriso is an application of all three libraries which creates, loads,
manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions.
Manipulation is not only adding or overwriting of files but also deletion,
renaming, and attribute changing. An incremental backup feature is provided.
The xorriso features are accessible via built-in command interpreters and
via a C language API.
SONAME:
libisoburn.so.1 (since 0.1.0, February 2008).
@section using Using the libraries
Our build system is based on autotools.
User experience tells us that you will need at least autotools version 1.7.
To build libisoburn go into its toplevel directory and execute:
- ./bootstrap (needed if you downloaded from SVN)
- ./configure
- make
To make the library and the xorriso application accessible for running and
software development:
- make install
For direct use as command line tool use the xorriso binary which among many
other features provides a mkisofs emulation via command "-as mkisofs".
See man page xorriso/xorriso.1 or GNU info document xorriso/xorriso.info.
If you want to link an own application with libisoburn, you have
two alternative APIs for choice:
- libisoburn, together with libburn and libisofs.
- xorriso, a complete representation of xorriso command line options.
It encapsulates the three lower level libraries.
Calls of both API families shall not be mixed.
For a description of the lbisoburn API read libisoburn/libisoburn.h
See file README for download and installation of a release tarball.
You will also have to install and understand the two libraries of the
Libburnia project which provide fundamental services:
libburn is the library by which preformatted data get onto optical media.
See libburn/libburn.h for its API description.
libisofs is the library to handle ISO 9660 filesystems with Rock Ridge
extensions. Its API is described in libisofs/libisofs.h .
For xorriso features see its man page xorriso/xorriso.1 or
its GNU info document xorriso/xorriso.info.
For the corresponding C language API see libisoburn/xorriso.h (or
xorriso/xorriso.h in the build directory).
The implementation this API is part of libisoburn.
The xorriso command line tool gets installed as dynamically linked
binary together with libisoburn.
There is also a statically linked release named GNU xorriso.
See xorriso/README_gnu_xorriso for its download and installation.
*/

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,407 @@
'''Libburnia Frequently Asked Questions'''
Please post your questions to
[https://lists.gnu.org/mailman/listinfo/bug-xorriso GNU xorriso mailing list].
----------------------------------------------------------------------------
'''Content:'''
Google favorites:
[#xorriso_not_found xorriso not found]
[#xorriso_tutorial xorriso tutorial]
[#xorriso_create_iso xorriso create ISO image]
Burning:
[#diff_cdrskin_xorriso What is the difference between cdrskin and xorriso ?]
[#scsi_error What does that SCSI error message mean ?]
[#concurrent_burn Why is simultaneous burning with multiple drives so slow ?]
Imaging:
[#edit_files Is there a way to edit files inside the ISO image ?]
[#boot_arch For which architectures xorriso is able to create bootable images ?]
[#isohybrid How to enable booting from USB stick ?]
[#partition_offset What is partition offset feature all about?]
[#partition_offset_apple Partition offset bad on Apple ?]
Development:
[#api_specs Where are the APIs of libburnia libraries described ?]
[#gui_advise I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ?]
Miscellaneous:
[#example_links Where to see examples ?]
[#xorriso_aliases What personalities are supported by xorriso ?]
[#xorriso_dialog_mode What is xorriso dialog mode useful for ?]
[#version_numbers Why is every second release missing ?]
----------------------------------------------------------------------------
'''Google favorites'''
----------------------------------------------------------------------------
===== xorriso not found ===== #xorriso_not_found
This message is issued by programs which use [wiki:Xorriso xorriso] for
producing ISO 9660 filesystem images. E.g. by GRUB2's grub-mkrescue.
Executable xorriso binaries are normally contained in software packages
named "libisoburn" or "xorriso".
If your operating system does not offer such a package, then consider
to get the [http://www.gnu.org/software/xorriso#download GNU xorriso]
source tarball. For instructions read in its
[http://www.gnu.org/software/xorriso/README_xorriso README file]
the paragraph "Compilation, First Glimpse, Installation".
With grub-mkrescue it is possible to use the resulting binary without further
installation. Just submit its absolute path with option --xorriso=. E.g.:
{{{
grub-mkrescue --xorriso=$HOME/xorriso-1.3.8/xorriso/xorriso -o output.iso
}}}
===== xorriso tutorial ===== #xorriso_tutorial
There is not much more than the
[http://www.gnu.org/software/xorriso/man_1_xorriso.html#EXAMPLES man xorriso examples].
Volunteers are wanted who make a collection of use cases, ask at bug-xorriso
for xorriso instructions to fulfill the needs, and describe both in a
user-readable manner.
Up to then, the GUI demo [http://svn.libburnia-project.org/libisoburn/trunk/frontend/README-tcltk xorriso-tcltk]
([http://www.gnu.org/software/xorriso/xorriso-tcltk-screen.gif screenshot])
may serve as interactive exploration tool. It needs xorriso >= 1.2.6, Tcl,
Tk >= 8.4, optionally Tcl / Tk package "BWidget".
{{{
xorriso-tcltk --script_log_file -
}}}
starts the GUI and will log the essential xorriso commands in the start
terminal. I.e. click on "Scan for drives" and learn that this operation
is triggered by xorriso command "-devices".
Click the rightmost mouse button while being over any of the GUI elements
in order to get the particular help text for that element.
Have [http://www.gnu.org/software/xorriso/man_1_xorriso.html man xorriso]
ready to learn what the particular commands mean.
===== xorriso create ISO image ===== #xorriso_create_iso
{{{
xorriso -outdev $HOME/result.iso \
-map /home/me/sounds /sounds \
-map /home/me/pictures /pictures
}}}
This points the output to file $HOME/result.iso, which should not yet exist.
Then it maps disk directory /home/me/sounds to ISO directory /sounds,
and /home/me/pictures to /pictures.
At program end, the ISO image gets produced and the contents of the
two directory trees gets copied into the ISO.
If you have experience with program mkisofs, you may also use its
emulation by xorriso:
{{{
xorriso -as mkisofs \
-o $HOME/result.iso \
-graft-points \
/sounds=/home/me/sounds \
/pictures=/home/me/pictures
}}}
See [http://www.gnu.org/software/xorriso/man_1_xorriso.html man xorriso]
for xorriso native commands.
See [http://www.gnu.org/software/xorriso/man_1_xorrisofs.html man xorriso]
for its mkisofs emulation.
----------------------------------------------------------------------------
'''Burning'''
----------------------------------------------------------------------------
===== What is the difference between cdrskin and xorriso ? ===== #diff_cdrskin_xorriso
[wiki:Cdrskin cdrskin] is a dedicated emulator of program cdrecord, based on
libburn. It tries to be as similar to cdrecord as is possible under that
premise.
[wiki:Xorriso xorriso] is an integrated tool which creates, loads, manipulates,
and writes ISO 9660 filesystem images with Rock Ridge extensions.
It is based on libburn, libisofs, and libisoburn. One of its features is
the emulation of the corresponding tasks as done by mkisofs and cdrecord.
===== What does that SCSI error message mean ? ===== #scsi_error
Error messages labled as "SCSI" stem from the drive. They are codes of
three hexadecimal numbers, like [3 0C 00]. The first number gives an overall
classification of the problem. The other two numbers give the particular
error description.
libburn translates known error codes into text messages. They consist of
two statements: the overall classification and the error description.
E.g. [3 0C 00] Medium error. Write error.
The classification allows a guess where the problem cause might sit:
2 "Drive not ready" : This is a well normal drive state and should be handled
by libburn. If you see this outside of DEBUG messages then it happened
at an unexpected occasion. Either libburn did its job wrong, or the hardware
suffers from blackouts. Hardware can be: drive, cable, bus controller.
Workaround: Check cables. If possible, try the drive at a different
bus controller.
3 "Medium error" : This indicates a problem between drive and medium. libburn
cannot directly cause such an error by any mistake. If drive and medium
are balancing on the edge of defect, it is possible that optional settings
can cause or prevent such errors. But in many cases of drive-medium conflicts
it is mere incident whether a burn run succeeds or not.
Workaround: Try other media or another drive.
4 "Drive error" : The drive or the bus controller accuse themselves of
doing it wrong. As with "Medium error" this might be aggravated or eased by
optional settings.
Workaround: Check cables. If possible, try the drive at a different
bus controller.
5 "Illegal request" : The drive did not like a command sent by libburn.
This may be normal. But if you see this outside of DEBUG messages, then
either the drive does not comply to MMC or libburn does not do its job right.
Workaround: Submit an error report to
[https://lists.gnu.org/mailman/listinfo/bug-xorriso GNU xorriso mailing list].
B "Command aborted" : Seems to be generated by some bus controllers or
operating system SCSI drivers. The newest outbreak is said to be due to USB 3
and drivers which do not prevent power saving.
Workaround: Plug USB drives to USB 2 sockets or have a recent operating
system kernel. If this does not help, contact
[https://lists.gnu.org/mailman/listinfo/bug-xorriso GNU xorriso mailing list]
and be ready for experiments.
===== Why is simultaneous burning with multiple drives so slow ? ===== #concurrent_burn
It is a known regression of Linux since about 2010 that operating more than
one drive at the same time via SCSI commands shows severe throughput problems.
See [ConcurrentLinuxSr the wiki page about this problem] which offers two
alternative workarounds in userspace, explanantions of the reason,
and a link to a remedy proposal by courageous kernel modification.
----------------------------------------------------------------------------
'''Imaging'''
----------------------------------------------------------------------------
===== Is there a way to edit files inside the ISO image ? ===== #edit_files
File content cannot be altered. But files may be replaced by new copies from
the disk filesystem.
The main method of manipulating an existing ISO image is to append a session
with a new complete directory tree and the file content of the added or
overwritten files. Depending on the media type you get gaps between sessions
of up to 20 MB. So better try to do all foreseeable changes by one add-on
session.
===== For which architectures xorriso is able to create bootable images ? ===== #boot_arch
Currently it supports systems with PC-BIOS via El Torito for booting from
CD, DVD, or BD media, and via MBR for booting from memory sticks or hard
disks. Further it supports machines with MIPS processor from SGI (Big Endian)
and DEC (Little Endian), and SUN SPARC machines.
(See [http://bazaar.launchpad.net/%7Elibburnia-team/libisofs/scdbackup/annotate/head%3A/doc/boot_sectors.txt libisofs/doc/boot_sectors.txt]
for technical details.)
Machines which support EFI may either boot via El Torito or use the files
of the ISO image directly. It is possible to append to the ISO image a
writeable FAT12 partition where files for EFI may be stored and changed.
===== How to enable booting from USB stick ? ===== #isohybrid
The ISOLINUX boot loader is normally started from CD, DVD or BD media
by a PC-BIOS via an El Torito boot record. But if the ISO image resides on an
USB stick or another hard-disk-like device, then PC-BIOS ignores El Torito
and rather expects a Master Boot Record (MBR). Both boot record types can
reside in the same ISO image. Therefore it is possible to create an MBR that
starts the boot image file of ISOLINUX which is already target of the El Torito
boot record. This kind of MBR is called "isohybrid". ISOLINUX provides
a program named isohybrid to patch existing images, but libisofs can create an
MBR already when producing the ISO image. See in
[http://www.gnu.org/software/xorriso/man_1_xorriso.html manual page of xorriso]
option -boot_image with arguments "isolinux" "system_area=",
and -as mkisofs option -isohybrid-mbr.
See [http://en.wikipedia.org/wiki/Master_boot_record Wikipedia on MBR] for
general information about PC-DOS Master Boot Records, and
[http://syslinux.zytor.com/wiki/index.php/ISOLINUX ISOLINUX wiki] for special
information about ISOLINUX. The wiki example with mkisofs can be performed
as well by help of xorriso option -as mkisofs.
A similar combination of El Torito and MBR is created by GRUB2 tool
grub-mkrescue. See [http://www.gnu.org/software/grub/ homepage of GNU GRUB 2]
for general information.
===== What is partition offset feature all about? ===== #partition_offset
If an MBR is present, then it contains a partition table with up to four
entries. The MBR is located at the very start of the ISO image. By
tradition the first partition should begin only after the range of MBR and
eventual supporting data blocks. On hard disk one often sees partition 1
starting at byte 63*512. Further it is tradition that the payload filesystem
is mountable via one of the partitions.
The isohybrid MBR has its only partition start at byte 0. Thus it is mountable
but does not obey the tradition to begin only after the MBR. The grub-mkrescue
MBR on the other hand has partition 1 start at byte 512, which makes it
unmountable. Only the unpartitioned base device can be mounted. (On GNU/Linux
e.g. /dev/sdb is the base device whereas /dev/sdb1 is partition 1.)
The compromise offered by libisofs is to create a second superblock at
address 16*2048 and to let start partition 1 at this address. The second
superblock leads to a second directory tree which takes into account the
address difference between partition 1 and the base device. So the image
gets mountable via both devices and reserves 32 kB for boot manager software
where it may manipulate and augment the MBR.
(See [http://libburnia-project.org/wiki/PartitionOffset Partition Offset Wiki]
for examples.)
There are reports of machines which will not boot from USB stick if
partition offset is 0.
===== Partition offset bad on Apple ? ===== #partition_offset_apple
Apple's "Snow Leopard" operating system refuses to mount Debian CD images
with non-zero partition offset.
The issue is still under investigation. But for now one has to choose
between mountability on Apple "Snow Leopard" or bootability from USB stick
on Kontron CG2100 "carrier grade server".
----------------------------------------------------------------------------
'''Developing'''
----------------------------------------------------------------------------
===== Where are the APIs of libburnia libraries described ? ===== #api_specs
The decisive references are the inclusion headers of the libraries
<libburn/libburn.h>, <libisofs/libisofs.h>, <libisoburn/libisoburn.h>,
and <libisoburn/xorriso.h>.
Current SVN versions of these files:
[http://libburnia-project.org/browser/libburn/trunk/libburn/libburn.h libburn/libburn.h] ,
[http://bazaar.launchpad.net/%7Elibburnia-team/libisofs/scdbackup/annotate/head%3A/libisofs/libisofs.h libisofs/libisofs.h] ,
[http://libburnia-project.org/browser/libisoburn/trunk/libisoburn/libisoburn.h libisoburn/libisoburn.h] ,
[http://libburnia-project.org/browser/libisoburn/trunk/xorriso/xorriso.h libisoburn/xorriso.h]
Doxygen generated API descriptions at
[http://api.libburnia-project.org api.libburnia-project.org]
might be slightly behind the latest developments.
===== I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ? ===== #gui_advise
Most appreciated would be a GUI for xorriso which allows to copy files from
a view of the hard disk filesystem to a view of the ISO filesystem, and vice
versa. The xorriso implementation is located inside libisoburn.
Each option that is described in
[http://www.gnu.org/software/xorriso/man_1_xorriso.html man 1 xorriso]
can be performed by a corresponding C function that is defined in
[http://libburnia-project.org/browser/libisoburn/trunk/xorriso/xorriso.h xorriso.h].
Further there are calls for library startup and shutdown, for problem
handling, and for the interpreters of xorriso's command line interface.
The xorriso API encapsulates calls to libisofs, libburn, and libisoburn.
An alternative to the xorriso C API is xorriso dialog mode.
[#xorriso_dialog_mode See below.]
The script
[http://libburnia-project.org/browser/libisoburn/trunk/frontend/xorriso-tcltk xorriso-tcltk]
demonstrates this approach. It is part of the
libisoburn release tarball and of the GNU xorriso tarball.
The known existing GUIs [http://www.xfce.org/projects/xfburn/ Xfburn],
[http://projects.gnome.org/brasero/ Brasero],
[http://flburn.sourceforge.net/ FlBurn]
rather use libisofs and libburn directly.
(Please submit an URI if you want your libburnia GUI application mentioned
here.)
----------------------------------------------------------------------------
'''Miscellaneous'''
----------------------------------------------------------------------------
===== Where to see examples ? ===== #example_links
[http://www.gnu.org/software/xorriso/man_1_xorriso.html#EXAMPLES xorriso examples] ,
[http://scdbackup.sourceforge.net/man_1_cdrskin_devel.html#EXAMPLES cdrskin examples] ,
[http://libburnia-project.org/browser/libburn/trunk/test/libburner.c libburner.c a minimal but complete burn program]
(also illustrated at the end of [http://api.libburnia-project.org/libburn/ libburn API intro]).
===== What personalities are supported by xorriso ? ===== #xorriso_aliases
The name by which xorriso is started may trigger certain features which
normally would need to be enabled by program options.
xorrisofs starts up in mkisofs emulation mode, which otherwise would have to
be entered by command -as "mkisofs".
xorrecord starts up in cdrecord emulation mode, which is normally entered by
command -as "cdrecord". This emulation is only able to write a single data
track as new session to blank or appendable media. No audio. No multiple
tracks in one session.
osirrox allows to copy files from ISO image to disk and to apply option -mount
to one or more of the existing ISO sessions. This is normally enabled by
option -osirrox "on:o_excl_off".
===== What is xorriso dialog mode useful for ? ===== #xorriso_dialog_mode
Dialog mode is initiated if -dialog "on" is among the program arguments.
It can be used to inspect and exploit existing ISO 9660 images or
to explore xorriso's behavior in order to develop the command sequence
for a batch run.
Frontend programmers may fork xorriso initiating a xorriso dialog session
(-dialog "on" -use_readline "off" -pkt_output "on" -mark "done"),
and interact with it from their own program via pipes connected to
xorriso's stdin and stdout. This is more efficient than forking xorriso
every now and then to perform various commands in order to complete
complex tasks like image size prediction.
The script
[http://libburnia-project.org/browser/libisoburn/trunk/frontend/xorriso-tcltk xorriso-tcltk]
demonstrates this approach. It is part of the
libisoburn release tarball and of the GNU xorriso tarball.
===== Why is every second release missing ? ===== #version_numbers
Releases have an even third version number. Like 0.5.6 or 1.0.4.
During development the next higher odd number is used. E.g. 0.5.7 or 1.0.5.
The content of release tarballs does not get changed without changing
their name. The development tarballs of xorriso and cdrskin may change
their content without notice.
----------------------------------------------------------------------------
Site maintainer: Do not edit this wiki directly but rather the SVN version
of libisoburn/trunk/doc/faq.wiki. When done, paste it into the wiki editor.

View File

@ -0,0 +1,47 @@
The argument names listed here have been reserved by Vladimir Serbinenko
for grub-mkrescue.
Do not use them as options of -as mkisofs or as generic commands.
Keep in mind with generic commands:
Leading '-' is ignored, inner '-' is mapped to '_'.
http://lists.gnu.org/archive/html/grub-devel/2015-04/msg00122.html
Date: Wed, 29 Apr 2015 16:05:04 +0200
From: Vladimir '?-coder/phcoder' Serbinenko <phcoder@gmail.com>
Subject: Re: grub-mkrescue problems in argp_parse
-------------------------------------------------------------------
--arcs-boot
--compress
--core-compress
--directory
--fonts
--grub-glue-efi
--grub-mkimage
--grub-render-label
--install-modules
--label-bgcolor
--label-color
--label-font
--locale-directory
--locales
--modules
--output
--override-directory
--product-name
--product-version
--pubkey
--rom-directory
--sparc-boot
--themes
--themes-directory
--verbose
--xorriso
-?
-k
-------------------------------------------------------------------
Known traditional collisions:
-------------------------------------------------------------------
-o intentionally overloaded
-v unintentional
-d unintentional

View File

@ -0,0 +1,232 @@
The partition offset feature of libisofs can produce ISO 9660 images which bear
a quite conventional partition table if copied onto a USB stick. The first
partition marks the size of the ISO image but starts at a non-zero address.
Thus it marks a small part of the device as unclaimed by partitions and
available for storing boot loader code.
Nevertheless the USB stick is mountable via its overall device file as well as
via the partition device file. E.g. on GNU/Linux: /dev/sdb and /dev/sdb1.
This is achieved by two distinct sets of meta-data which refer to the same
file content.
The dual-mount feature supports Rock Ridge and Joliet too.
It is capable of multi-session.
Currently only offset 32 kB seems to make sense. Smaller offsets are prohibited
by fundamental assumptions of libisofs and libisoburn. Larger offsets would
extend the unclaimed area into vital blocks of the ISO image.
--------------------------------------------------------------------------
Meanwhile Debian
[http://cdimage.debian.org/cdimage/daily-builds/daily/current/ daily]
and [http://cdimage.debian.org/cdimage/weekly-builds/ weekly] builds make
use of this feature with their bootable ISO images for i386. E.g.
[http://cdimage.debian.org/cdimage/daily-builds/daily/current/i386/iso-cd/debian-testing-i386-netinst.iso debian-testing-i386-netinst.iso].
According to a
[http://syslinux.zytor.com/archives/2011-March/016201.html thread of march 2011]
on Syslinux mailing list this enabled booting of a Kontron CG2100 server
from USB stick, which otherwise failed.
Regrettably the feature seems to prevent mounting of ISO 9660 images on
Apple "Snow Leopard" systems.
At least this is the outcome of a
[http://lists.debian.org/debian-cd/2011/04/msg00029.html debian-cd thread of april 2011].
--------------------------------------------------------------------------
Example:
Testing mountability and ISOLINUX bootability from USB stick and CD.
Overview:
The test image was derived from one year old RIPLinux-9.3-non-X.iso which
has an isohybrid MBR. Syslinux version seems to be 3.82. That MBR and the file
tree from the mounted RIPLinux image was used to build a new ISO image
with 16 * 2kB partition offset. Isohybrid MBR patching was done by xorriso.
Details:
The first 32 kB of an ISO 9660 image are called System Area and may host any
byte pattern. The first 512 bytes of RIPLinux-9.3-non-X.iso contain the
isohybrid capable MBR, which will be re-used in this example.
{{{
dd if=RIPLinux-9.3-non-X.iso bs=512 count=1 of=RIPLinux-9.3-non-X.mbr
}}}
Normally the isohybrid MBR is provided by the Syslinux
installation under the name isohdp[fp]x*.bin .
E.g. /usr/lib/syslinux/isohdpfx.bin
The files of the image are made accessible for reading
{{{
mount -o loop RIPLinux-9.3-non-X.iso /mnt
}}}
A new ISO image gets composed. The first three lines of arguments are taken
from the prescriptions of ISOLINUX wiki and adapted to the names used in
RIPLinux-9.3-non-X.iso.
Option -isohybrid-mbr imports the copied MBR and patches it
according to rules published by hpa on Syslinux mailing list.
Option -partition_offset 16 causes the first partition to start at 2 kB block
number 16. It also prepares the image to be mountable by this partition, too.
{{{
xorriso -as mkisofs \
-o new_image.iso \
-b boot/isolinux/isolinux.bin -c boot/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-isohybrid-mbr RIPLinux-9.3-non-X.mbr \
-partition_offset 16 \
/mnt
}}}
The image was copied onto a USB stick
{{{
dd if=new_image.iso of=/dev/sdc
}}}
and plugged into a Debian system.
{{{
fdisk -lu /dev/sdb
}}}
yields
{{{
Device Boot Start End Blocks Id System
/dev/sdb1 * 64 120831 60384 17 Hidden HPFS/NTFS
}}}
I can mount /dev/sdb and /dev/sdb1 alike:
{{{
mount /dev/sdb1 /mnt1
mount -o loop /dev/sdb /mnt
}}}
-o loop avoids failure with "mount: /dev/sdb already mounted or /mnt busy".
A comparison by
{{{
diff -r /mnt /mnt1
}}}
reports no difference.
Human readable files look ok.
Test-reading all content by
{{{
tar cf - /mnt | wc
}}}
yields a reasonable byte count of 60743680 and no errors.
The machine boots RIPLinux from this USB stick with no visible problems.
It can then mount /dev/sdb as well as /dev/sdb1.
The ISO image boots from CD too.
Mounting the partition can be simulated with an image file on hard disk by
cutting off the first partition_offset blocks of 2 KB:
{{{
dd if=new_image.iso of=partition_image.iso bs=2048 skip=16
mount -o loop partition_image.iso /mnt1
}}}
--------------------------------------------------------------------------
Another test was made with GRUB 2 by downloading
{{{
bzr branch http://bzr.savannah.gnu.org/r/grub/trunk/grub
}}}
Before building GRUB 2, the file
{{{
util/grub-mkrescue.in
}}}
was edited to replace in the options of the xorriso command:
{{{
--protective-msdos-label
}}}
by
{{{
-partition_offset 16 -no-pad
}}}
Then GRUB 2 was built and installed.
The resulting image from
{{{
./grub-mkrescue -o image.iso
}}}
was put onto USB stick. It passed the same tests on Debian
as above RIPLinux example. It boots to a GRUB prompt.
Due to option -no-pad the image is about 250 kB smaller than
the image produced by original grub-mkrescue. Else it would have grown by
about 50 kB.
Unpadded ISO images are safe except for burning on CD in TAO mode.
In this case problems may occur with reading the last few data blocks.
So when burning onto CD make sure to require SAO mode and/or to
require padding by 300 kB.
Burning on DVD or BD needs no such caution. Neither does copying
on USB stick or hard disk.
Program fdisk will complain about "different physical/logical" addresses.
This can be silenced by adding option
{{{
-partition_cyl_align on
}}}
at the cost of image padding up to the next full MB.
E.g. by 402 kB to 2 MB.
--------------------------------------------------------------------------
Open questions:
- Shall the partition of an isohybrid image be marked bootable ?
Currently xorriso keeps the 0x80 mark of an imported MBR
and the 0x80 mark which xorriso sets by its own MBR
preparations.
- If not to be marked bootable:
What equipment would the partition need to justify having the mark ?
------------------------------------------------------------------------
Application:
The partition offset feature can be controlled by libisofs API calls
{{{
int iso_write_opts_set_part_offset(IsoWriteOpts *opts,
uint32_t block_offset_2k,
int secs_512_per_head,
int heads_per_cyl);
int iso_write_opts_set_system_area(IsoWriteOpts *opts, char data[32768],
int options, int flag);
}}}
or by libisoburn calls
{{{
int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts,
uint32_t block_offset_2k,
int secs_512_per_head, int heads_per_cyl);
int isoburn_igopt_get_part_offset(struct isoburn_imgen_opts *opts,
uint32_t *block_offset_2k,
int *secs_512_per_head, int *heads_per_cyl);
int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o,
char data[32768], int options);
int isoburn_igopt_get_system_area(struct isoburn_imgen_opts *o,
char data[32768], int *options);
}}}
or by xorriso options
{{{
-boot_image any partition_offset=(2kb_block_adr)
-boot_image any partition_sec_hd=(number)
-boot_image any partition_hd_cyl=(number)
-boot_image any partition_cyl_align(on|auto|off)
-as mkisofs ... -partition_offset (2kb_block_adr) \
-partition_hd_cyl (number) \
-partition_sec_hd (number) \
-partition_cyl_align (on|auto|off) ...
}}}
As stated above, an offset larger than 16 would expose vital parts of the
ISO image as unclaimed space. Values smaller than 16 are not accepted.
So use either an offset of 16 blocks or keep the feature disabled by
offset 0.

View File

@ -0,0 +1,518 @@
This text describes how to set up a qemu virtual machine so that xorriso
on its guest GNU/Linux can operate a CD, DVD or BD recorder of the host
system.
The options follow proposals of Paolo Bonzini on qemu-devel mailing list.
My compliments for his patient guidance.
Basic knowledge about Debian and qemu was learned from
[http://www.gnu.org/s/hurd/hurd/running/qemu.html GNU Hurd qemu page].
----------------------------------------------------------------------
This start command works with qemu-1.0-rc3:
{{{
$ qemu \
-enable-kvm \
-nographic \
-m 512 \
-net nic,model=ne2k_pci \
-net user,hostfwd=tcp::5557-:22 \
-hda /dvdbuffer/i386-install.qemu \
-drive file=/dev/sr0,if=none,id=scsicd,format=raw \
-device virtio-blk-pci,drive=scsicd,logical_block_size=2048,physical_block_size=2048 \
-cdrom .../some_image.iso
}}}
This start command works with qemu-2.1.2:
{{{
$ qemu \
-enable-kvm \
-nographic \
-m 512 \
-net nic,model=ne2k_pci \
-net user,hostfwd=tcp::5557-:22 \
-hda /dvdbuffer/i386-install.qemu \
-cdrom .../some_image.iso \
-drive file=/dev/sr0,index=2,if=virtio
}}}
With these setups of -drive and -device it is necessary to have a
medium in the drive, when qemu gets started. Else it will refuse.
The guest system is accessible via ssh and scp at port 5557 of the
host system.
'''/dev/sr0''' is the address of the DVD drive which is handed over to the
guest system.
'''.../some_image.iso''' may be any readable file which shall serve as
virtual DVD-ROM. qemu is not happy without such a thing.
'''/dvdbuffer/i386-install.qemu''' is the disk image, where the guest operating
system was installed by:
{{{
$ qemu-img create /dvdbuffer/i386-install.qemu 8G
$ qemu \
-enable-kvm \
-m 512 \
-net nic,model=ne2k_pci \
-hda /dvdbuffer/i386-install.qemu \
-cdrom debian-6.0.3-i386-netinst.iso \
-boot d
}}}
Host system of my qemu-1.0-rc3 test is Debian GNU/Linux 6.0.2 amd64.
With qemu-2.1.2 it is Debian 8.1 amd64.
Both had access to the Internet when the guest was installed.
----------------------------------------------------------------------
Preparations on guest system Debian GNU/Linux 6.0.3 i386
There appears no /dev/sr for the passthrough drive. Thus libburn will not
list it by its drive search function. One may use it nevertheless. But
xorriso will only do so if prefix "mmc:" is used with the address:
{{{
-dev mmc:/dev/vda
}}}
The drive will be listed by libburn if there is a symbolic link /dev/sr*
pointing to it. On Debian 6, this link persists only if it is created
by an udev rule.
In /lib/udev/rules.d/50-udev-default.rules:
{{{
KERNEL=="vda", SYMLINK+="sr1"
}}}
libburn on Linux needs rw-permission for the drive's device node.
The virtual device /dev/vda is in group "disk". Usual for CD drives is
group "cdrom", to which i (or the Debian installer ?) have added my
normal user when i installed the guest system.
Like with the symbolic link, such a change persists on Debian 6 only as
udev rule.
In /lib/udev/rules.d/91-permissions.rules:
{{{
KERNEL=="vda", GROUP="cdrom"
}}}
This should yield
{{{
lrwxrwxrwx 1 root root 3 Nov 8 11:19 /dev/sr1 -> vda
brw-rw---- 1 root cdrom 254, 0 Nov 8 11:19 /dev/vda
}}}
xorriso version must be >= 1.1.8
{{{
$ xorriso -version
}}}
tells the versions of its components on stdout:
{{{
...
xorriso version : 1.1.8
...
}}}
If your distro's xorriso is too old, consider to get and build GNU xorriso.
{{{
http://ftpmirror.gnu.org/xorriso/xorriso-1.1.8.tar.gz
}}}
Do
{{{
$ tar xzf xorriso-1.1.8.tar.gz
$ cd xorriso-1.1.8
$ ./configure && make
}}}
Either do as superuser
{{{
# make install
}}}
or execute it where it was built as
{{{
$ ./xorriso/xorriso ...arguments...
}}}
After compilation, this binary does not depend on files in the build
directory. You may move it to any other location.
For details about the following xorriso commands, read
{{{
man xorriso
man ./xorriso/xorriso.1
}}}
or with the same content
{{{
info xorriso
info ./xorriso/xorriso.info
}}}
Or read the [http://scdbackup.sourceforge.net/man_1_xorriso_devel.html online man page of xorriso].
Note that the sequence of xorriso arguments matters. They are commands
which get performed one after the other.
This differs from the behavior of mkisofs, cdrecord, et.al.,
which parse all arguments and then perform actions in a hardcoded
sequence.
Writing happens automatically if ISO filetree changes are pending
at the end of the program run. This is like with other burn tools.
(There is a command -commit for intermediate writing e.g. in dialog
mode.)
----------------------------------------------------------------------
Listing accessible drives:
{{{
$ xorriso -devices
}}}
shows on stdout:
{{{
0 -dev '/dev/sr0' rwrw-- : 'QEMU ' 'QEMU DVD-ROM'
1 -dev '/dev/sr1' rwrw-- : 'Optiarc ' 'BD RW BD-5300S'
}}}
----------------------------------------------------------------------
The burn tests are presented here for unformatted DVD-RW media.
The xorriso commands apply also to other types of optical media.
See "Other applicable media types:" further below.
----------------------------------------------------------------------
Inspecting drive and medium:
{{{
$ xorriso -outdev /dev/sr1 -toc
}}}
should show on stdout something like
{{{
Drive current: -dev '/dev/sr1'
Drive type : vendor 'Optiarc' product 'BD RW BD-5300S' revision '1.04'
Media current: DVD-RW sequential recording
Media product: RITEKW04 , Ritek Corp
Media status : is written , is closed
Media blocks : 306592 readable , 0 writable , 2298496 overall
TOC layout : Idx , sbsector , Size , Volume Id
ISO session : 1 , 0 , 106696s , ISOIMAGE
ISO session : 2 , 135536 , 108385s , ISOIMAGE
ISO session : 3 , 250240 , 56202s , ISOIMAGE
Media summary: 3 sessions, 271744 data blocks, 531m data, 0 free
}}}
----------------------------------------------------------------------
Blanking to single session capability:
This medium has to be blanked before further writing. For the DAO
test, one can save time by fast blanking, which xorriso normally
dislikes because the result is not capable of multi-session:
{{{
$ xorriso -outdev /dev/sr1 -blank deformat_quickest
}}}
should report on stderr
{{{
...
xorriso : UPDATE : Blanking ( 1.0% done in 2 seconds )
...
xorriso : UPDATE : Blanking ( 95.4% done in 36 seconds )
xorriso : UPDATE : Blanking ( 99.0% done in 37 seconds )
...
Media current: DVD-RW sequential recording
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 4489m free
}}}
Do not worry if the pacifier messages show no neat percentage progress.
Some drives report "1.0%" until they are done. Some report "1.0%"
after "99%".
----------------------------------------------------------------------
Writing a DAO session:
Use one or more moderately sized directories as input. Here: /usr/bin.
Terminate the list of -add arguments by argument "--".
It is important to have command -close "on" among the arguments.
{{{
$ xorriso -md5 on -outdev /dev/sr1 -close on -add /usr/bin --
}}}
should report on stderr
{{{
...
xorriso : UPDATE : 594 files added in 1 seconds
...
xorriso : UPDATE : Thank you for being patient. Working since 2 seconds.
xorriso : UPDATE : Writing: 32s 0.1% fifo 100% buf 0% 0.1xD
...
xorriso : UPDATE : Writing: 2704s 5.1% fifo 11% buf 0% 3.9xD
...
xorriso : UPDATE : Writing: 20208s 38.2% fifo 52% buf 99% 4.0xD
...
xorriso : UPDATE : Writing: 52885s 100.0% fifo 0% buf 99% 0.0xD
ISO image produced: 52735 sectors
Written to media : 52885 sectors at LBA 0
Writing to '/dev/sr1' completed successfully.
}}}
Do not worry if there is no progress to see for a few dozen seconds
at the beginning.
The run will last at least as long as writing of 1 GB would need.
If you write less data, then there will be a lot of zero progress
messages at the end of writing.
----------------------------------------------------------------------
Checkreading the result:
{{{
$ xorriso -md5 on -indev /dev/sr1 -check_md5_r sorry / --
}}}
The word "sorry" sets the severity class of the event message, which is
emitted in case of MD5 mismatch. (See man xorriso, "Exception processing".)
This should report on stderr
{{{
...
Drive current: -indev '/dev/sr1'
Media current: DVD-RW sequential recording
Media status : is written , is closed
Media summary: 1 session, 52885 data blocks, 103m data, 0 free
Volume id : 'ISOIMAGE'
xorriso : UPDATE : 568079 content bytes read in 5 seconds
xorriso : UPDATE : 17074k content bytes read in 10 seconds
...
xorriso : UPDATE : 103.7m content bytes read in 35 seconds
File contents and their MD5 checksums match.
}}}
and the exit value should be 0, if no mismatch was reported.
A mismatch message would look like
{{{
...
MD5 MISMATCH: '/usr/bin/ncursesw5-config'
...
Mismatch detected between file contents and MD5 checksums.
xorriso : SORRY : Event triggered by MD5 comparison mismatch
xorriso : NOTE : Tolerated problem event of severity 'SORRY'
xorriso : NOTE : -return_with SORRY 32 triggered by problem severity SORRY
}}}
and the exit value would be non-zero.
----------------------------------------------------------------------
Blanking to multi-session capability:
{{{
$ xorriso -outdev /dev/sr1 -blank as_needed
}}}
This will need as long as writing the DVD-RW up to its end.
Blanking option "as_needed" lets xorriso decide what to do in order
to make the medium writable from scratch. With DVD-RW it will decide for
-blank "all".
The report on stderr should end by
{{{
...
xorriso : UPDATE : Blanking ( 98.9% done in 902 seconds )
xorriso : UPDATE : Blanking ( 99.0% done in 903 seconds )
xorriso : UPDATE : Blanking ( 99.0% done in 904 seconds )
Blanking done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: DVD-RW sequential recording
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 4489m free
}}}
----------------------------------------------------------------------
Writing multiple sessions (DVD-RW write type Incremental):
This time do not perform command -close "on", so that the medium
stays writable:
{{{
$ xorriso -md5 on -dev /dev/sr1 -add /usr/lib --
...
xorriso : UPDATE : Writing: 105280s 98.6% fifo 0% buf 77% 3.5xD
xorriso : UPDATE : Writing: 106796s 100.0% fifo 0% buf 62% 2.2xD
xorriso : UPDATE : Closing track/session. Working since 44 seconds
...
xorriso : UPDATE : Closing track/session. Working since 77 seconds
ISO image produced: 106646 sectors
Written to media : 106800 sectors at LBA 0
Writing to '/dev/sr1' completed successfully.
}}}
Checkread like after the DAO test:
{{{
$ xorriso -md5 on -indev /dev/sr1 -check_md5_r sorry / --
...
xorriso : UPDATE : 204.0m content bytes read in 63 seconds
File contents and their MD5 checksums match.
}}}
Writing the second session looks like the first one. Just use another
set of input files to get a visible change in the ISO 9660 file tree:
{{{
$ xorriso -md5 on -dev /dev/sr1 -add /usr/bin --
...
Written to media : 53408 sectors at LBA 135488
Writing to '/dev/sr1' completed successfully.
}}}
And checkread the whole tree of files (i.e. both sessions):
{{{
$ xorriso -md5 on -indev /dev/sr1 -check_md5_r sorry / --
...
xorriso : UPDATE : 307.8m content bytes read in 89 seconds
File contents and their MD5 checksums match.
}}}
At the end of writing a final session, the medium can be closed.
It will not take more writing unless it gets blanked or formatted.
So use command -close "on" to demand closing after writing.
{{{
$ xorriso -md5 on -dev /dev/sr1 -close on -add /usr/sbin --
...
Written to media : 16160 sectors at LBA 195056
Writing to '/dev/sr1' completed successfully.
}}}
Checkread
{{{
$ xorriso -md5 on -indev /dev/sr1 -check_md5_r sorry / --
...
Media current: DVD-RW sequential recording
Media status : is written , is closed
Media summary: 3 sessions, 176368 data blocks, 344m data, 4064m free
...
xorriso : UPDATE : 337.7m content bytes read in 97 seconds
File contents and their MD5 checksums match.
}}}
-----------------------------------------------------------------------------
If the drive tray can move by itself, you may now eject the medium:
{{{
$ xorriso -outdev /dev/sr1 -eject all
}}}
-----------------------------------------------------------------------------
Other applicable media types:
These test runs for sequential DVD-RW may be performed on CD-RW with the
same xorriso arguments. Be aware that /usr/lib will hardly fit on a CD.
So choose smaller directories for CD.
-blank "deformat_quickest" addresses a peculiarity of DVD-RW.
It will work on other media like -blank "fast".
Except the blanking runs, the tests may also be performed on BD-R, DVD-R,
DVD+R, and CD-R. But you would waste two media by this.
The first session on CD will always be written with write type SAO,
further sessions will be written with TAO.
CD-R and DVD-R have a simulation mode. It can be enabled by xorriso
command -dummy "on", but of course it will not produce readable results.
So this simulation is usable only for first sessions on blank media.
-----------------------------------------------------------------------------
Now for formatted overwritable media:
All blank, write and check runs of above tests "Writing multiple sessions"
may also be performed with DVD+RW, DVD-RAM, formatted DVD-RW, and BD-RE.
There is no way to close formatted media. The command -close "on"
gets silently ignored.
The write methods and states of formatted media differ from those of
sequential media. But xorriso presents to the user a unified
multi-session usage model, under the assumption that all emulated
sessions contain ISO 9660 filesystem images, which successively
build on each other.
So from the view of xorriso commands, the only task which makes
them differ from sequential media, is to apply optional formatting
or re-formatting.
A special case are BD-R, which xorriso may format but will not bring
into (pseudo-) overwritable state. Formatted BD-R perform Defect
Management by default, which checkreads during writing and replaces
bad block.
The mandatory formatting of unused DVD+RW and BD-RE is done by xorriso
automatically. Just start a normal write run. DVD-RAM are sold formatted.
xorriso treats overwritable media with a valid ISO 9660 filesystem as
appendable media. To make then writable from scratch, apply
-blank "as_needed", which will actually write a few bytes into the PVD
(superblock) of the ISO filesystem to invalidate it.
De-formatting is only possible with DVD-RW. E.g. by -blank "deformat".
-----------------------------------------------------------------------------
Format DVD-RW for overwriting without intermediate blanking,
or format BD-R for Defect Management:
{{{
$ xorriso -outdev /dev/sr1 -format as_needed
}}}
should report on stderr
{{{
...
xorriso : UPDATE : Formatting ( 99.0% done in 912 seconds )
Formatting done
xorriso : NOTE : Re-assessing -outdev '/dev/sr1'
Drive current: -outdev '/dev/sr1'
Media current: DVD-RW restricted overwrite
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 4488m free
}}}
As with blanking, one should not worry if the progress messages show
unplausible percentages. Some drives are more equal than others.
Formatting is said to be much stress to the medium. -format option
"as_needed" applies it only to yet unformatted media.
When performing above write tests, take care to use -blank "as_needed"
rather than -blank "deformat_quickest". Else you will get a sequential
unformatted DVD-RW rather than a formatted DVD-RW which xorriso is
willing to write from scratch.
There is no use in a separate "DAO" test on overwritable media anyway.
-----------------------------------------------------------------------------
Change the formatted size of a BD-RE:
First learn about formatted size and proposals of other sizes.
(One can issue own wishes, too. See in man xorriso, command -format.)
{{{
$ xorriso -outdev /dev/sr1 -list_formats
}}}
should tell on stdout
{{{
...
Format status: formatted, with 23610.0 MiB
BD Spare Area: 0 blocks consumed, 131072 blocks available
Format idx 0 : 00h , 11826176s , 23098.0 MiB
Format idx 1 : 01h , 11564032s , 22586.0 MiB
Format idx 2 : 30h , 11826176s , 23098.0 MiB
Format idx 3 : 30h , 11564032s , 22586.0 MiB
Format idx 4 : 30h , 12088320s , 23610.0 MiB
Format idx 5 : 31h , 12219392s , 23866.0 MiB
}}}
So lets go back from 23610.0 MiB to the default size of 23098.0 MiB
{{{
$ xorriso -outdev /dev/sr1 -format by_index_2 -blank as_needed
...
Media summary: 2 sessions, 105470 data blocks, 206m data, 22.4g free
}}}
Although the heads of the old sessions might remain readable after
-format, better do not rely on this and a append -blank "as_needed" to
avoid any data corruption.
If you want to keep the data, then make at least a checkread run.
Check whether the size has changed:
{{{
$ xorriso -outdev /dev/sr1 -list_formats
}}}
should tell on stdout
{{{
...
Format status: formatted, with 23098.0 MiB
BD Spare Area: 0 blocks consumed, 393216 blocks available
...
}}}

View File

@ -0,0 +1,22 @@
# This is an example for a xorriso startup file.
# If found at one of the following addresses then its text lines will get
# executed by xorriso as commands before any of its program arguments:
# /etc/default/xorriso
# /etc/opt/xorriso/rc
# /etc/xorriso/xorriso.conf
# $HOME/.xorrisorc
# Note: Command -no_rc as first program argument prevents this execution.
# Disallow the use of hard disk /dev/sda and its partitions as
# pseudo-drive (e.g. as output target of an ISO image).
-drive_class banned /dev/sda*
# Allow the use of /dev/sdb, /dev/sdc, and /dev/sdd as pseudo-drives
# without the prefix "stdio:" which is usually required for device addresses
# which begin by "/dev/" but represent no CD drives.
-drive_class harmless /dev/sd[bcd]

View File

@ -0,0 +1,127 @@
------------------------------------------------------------------------------
xorriso-tcltk
------------------------------------------------------------------------------
Copyright (C) 2012 - 2013
Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
Provided under BSD license: Use, modify, and distribute as you like.
------------------------------------------------------------------------------
xorriso-tcltk is mainly a proof of concept for a frontend that operates
xorriso in dialog mode.
Dependencies:
- xorriso ISO 9660 Rock Ridge filesystem manipulator and CD/DVD/BD burn program
- Tcl programming language
- Tk widget toolkit
- optionally the Tcl/Tk package BWidget
It exercises several fundamental gestures of communication:
- connecting via two pipes
- sending commands
- receiving replies
- inquiring the xorriso message sieve
- using the xorriso parsing service
Note that any other language than Tcl/Tk could be used, if it only can
do i/o via standard input and standard output or via named pipes.
Further it has to perform integer arithmetics and string manipulations.
And, well, a graphical widget set would be nice.
See man xorriso for a documentation of xorriso concepts and commands.
See man xorrecord for details of the burn image file feature.
Quick start
In the xorriso build directory, without installation of xorriso:
xorriso/xorriso -launch_frontend frontend/xorriso-tcltk --stdio --
After installation of xorriso by make install:
xorriso-tcltk
Overview of GUI
The window is separated into three main areas:
- Connection to xorriso.
- Management of drives and image files.
- Inspection, manipulation, and exploitation of xorriso ISO image model.
Click the rightmost mouse button while being over any of the GUI elements
in order to get the particular help text for that element.
There is no need to close the help window. Just click another element to
get another help text.
The "Help" button in the upper right corner gives a short overview and
instructions for several common use cases.
Program start options
The Tcl shell "wish" is allergic to options which start by "-h".
So here is the output of xorriso-tcltk --help :
------------------------------------------------------------------------
Usage:
frontend/xorriso-tcltk [options]
Options:
All options must be given with two dashes ("--option") in
order to distinguish them from any options of the Tcl shell.
--help
Print this text and exit.
--stdio
Establish connection to xorriso via stdin and stdout.
E.g. when letting xorriso start this frontend program:
xorriso -launch_frontend $(which xorriso-tcltk) --stdio --
--named_pipes cmd_fifo reply_fifo
Establish connection to a xorriso process started by:
xorriso -dialog on <cmd_fifo >reply_fifo
which is then ready for a run of:
xorriso-tcltk --named_pipes cmd_fifo reply_fifo
It is important that the parent of xorriso and of this
tcl/tk frontend opens the named pipe for commands before
it opens the named pipe for replies. This avoids deadlock.
--silent_start
Do not issue the start message xorriso-tcltk-version.
This works only if --silent_start is the first argument.
--no_extract
Do not allow extraction of files from ISO filesystem to
hard disk. This is not revokable during the program run.
--no_bwidget
Do not try to load the Tcl/Tk package BWidget which is
a prerequisite for the "/" file browser buttons.
--geometry {+|-}X{+|-}Y
Sets the position of the main window.
--click_to_focus
Chooses that input fields and list boxes get the keyboard
focus only when being clicked by the mouse. (Default)
--auto_focus
Chooses that the keyboard focus is where the mouse
pointer is.
--pipe_log_file path
Set a file address for logging of xorriso commands and
reply messages and enable this logging.
The log lines will be appended. Path "-" means stderr.
--script_log_file path
Set a file address for logging of essential xorriso
commands and enable this logging.
The log lines will be appended. Path "-" means stderr.
--script_log_all_commands
With logging of commands log non-essential commands too.
--use_command_move
Use xorriso command -move for the "Move to: button
if xorriso version is >= 1.2.8
--use_command_mv
Use xorriso command -mv for the "Move to:" button.
If neither --stdio nor --named_pipes is given, then this script
will try to locate itself in the filesystem and start a xorriso
run that launches it again.
In the running GUI, click with the rightmost mouse button on
any GUI element to get its particular help text.
------------------------------------------------------------------------

View File

@ -0,0 +1,980 @@
/* Beefed-up example from man 2 pipe
to illustrate how xorriso is to be used by frontend programs via two pipes.
Additionally there is a standalone implementation of Xorriso_parse_line().
Copyright 2012 Thomas Schmitt, <scdbackup@gmx.net>
Unaltered provided under BSD license.
You may issue licenses of your choice for derived code, provided that they
do not infringe anybody's right to do the same for this original code.
Build:
cc -g -o frontend_pipes_xorriso frontend_pipes_xorriso.c
Usage:
./frontend_pipes_xorriso [path_to_xorriso_binary | -h]
*/
#include <sys/wait.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
static int usage()
{
static char helptext[][80] = {
"usage: frontend_pipes_xorriso [path_to_xorriso|-h]",
"",
"Forks a process that runs xorriso and communicates with it via two pipes.",
"The command pipe sends payload commands and -mark commands. The reply pipe",
"receives -pkt_output lines which it dispatches to stdout and stderr.",
"The communication between both processes is made synchronous by the parent",
"awaiting the -mark message of the child.",
"Optionally the reply lines can be parsed into words. This is initiated by",
"meta command",
" @parse [prefix [separators [max_words [flag]]]]",
"which sets the four parameters for a function equivalent to",
"Xorriso_parse_line() (see xorriso.h). All reply will then be parsed and",
"non-empty word arrays are displayed. Meta command",
" @noparse",
"ends this mode.",
"Meta command",
" @drain_sieve",
"reports all recorded results of all installed message sieve filter rules.",
"For illustration perform this xorriso command sequence",
" -msg_op start_sieve - -outdev /dev/sr0 -msg_op clear_sieve - -toc",
"and then @drain_sieve.",
"@END@"
};
int i;
for (i = 0; strcmp(helptext[i], "@END@") != 0; i++)
fprintf(stderr, "%s\n", helptext[i]);
return(1);
}
/* Local helpers of parent process */
struct boss_state {
/* What the parent needs to know about its connection to xorriso */
/* The ends of the dialog pipes */
int command_fd;
int reply_fd;
/* For synchronization between boss and xorriso */
int mark_count;
char pending_mark[16];
/* Parsing_parameters. See xorriso.h Xorriso_parse_line */
int do_parse;
char progname[1024];
char prefix[1024];
char separators[256];
int max_words;
int flag;
/* A primitive catcher for result lines */
int reply_lines_size; /* 0= catching disabled */
char **reply_lines;
int reply_lines_count;
};
#define Frontend_xorriso_max_resulT 1000
/* Some basic gestures of this program: */
static int prompt_for_command(struct boss_state *boss,
char *line, int line_size);
static int transmit_command(struct boss_state *boss, char *line);
static int await_all_replies(struct boss_state *boss);
static int de_pkt_result(struct boss_state *boss);
static int drain_sieve(struct boss_state *boss);
int parse_line(char *progname, char *line,
char *prefix, char *separators, int max_words,
int *argc, char ***argv, int flag);
int dispose_parsed_words(int *argc, char ***argv);
/* Parent and child */
int main(int argc, char *argv[])
{
int command_pipe[2], reply_pipe[2];
pid_t cpid;
char *xorriso_path = "/usr/bin/xorriso";
if (argc > 1) {
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "-help") == 0 ||
strcmp(argv[1], "--help") == 0) {
usage();
exit(0);
}
xorriso_path = argv[1];
}
if (pipe(command_pipe) == -1)
{ perror("pipe"); exit(1); }
if (pipe(reply_pipe) == -1)
{ perror("pipe"); exit(1); }
cpid = fork();
if (cpid == -1)
{ perror("fork"); exit(2); }
if (cpid == 0) {
/* Child redirects stdin and stdout. Then it becomes xorriso. */
char *xargv[8];
close(command_pipe[1]); /* Close unused write end */
close(reply_pipe[0]); /* Close unused read end */
/* Attach pipe ends to stdin and stdout */
close(0);
if (dup2(command_pipe[0], 0) == -1)
{ perror("dup2(,0)"); exit(1); }
close(1);
if (dup2(reply_pipe[1], 1) == -1)
{ perror("dup2(,1)"); exit(1); }
xargv[0] = xorriso_path;
xargv[1] = "-dialog";
xargv[2] = "on";
xargv[3] = "-pkt_output";
xargv[4] = "on";
xargv[5] = "-mark";
xargv[6] = "0"; /* corresponds to mark_count = 0 in parent */
xargv[7] = NULL;
execv(xorriso_path, xargv);
perror("execv"); exit(1);
} else {
/* Parent prompts user for command lines and prints xorriso replies.
It knows when all reply text of the pending command line has arrived
by watching for -mark reply pending_mark.
*/
int ret;
char line[4096];
struct boss_state boss;
close(command_pipe[0]); /* Close unused read end */
close(reply_pipe[1]); /* Close unused write end */
memset(&boss, 0, sizeof(boss));
boss.command_fd = command_pipe[1];
boss.reply_fd = reply_pipe[0];
strcpy(boss.progname, argv[0]);
boss.reply_lines = NULL;
/* Dialog loop */
sprintf(boss.pending_mark, "%d", boss.mark_count);
while (1) {
/* Wait for pending mark and print all replies */
ret = await_all_replies(&boss);
if (ret < 0)
break;
/* Prompt for command line */
ret = prompt_for_command(&boss, line, sizeof(line));
if (ret <= 0)
break;
/* Send line and -mark command */
ret = transmit_command(&boss, line);
if (ret <= 0)
break;
}
/* >>> if child is still operational: send -rollback_end */;
/* >>> wait a short while */;
/* >>> if not yet ended: kill child */;
wait(NULL); /* Wait for child */
exit(0);
}
}
/* ------------------- Local helpers of parent process -------------------- */
static int show_parsed(struct boss_state *boss, char *line);
static int record_reply_line(struct boss_state *boss, char *line);
static int make_reply_lines(struct boss_state *boss);
static int input_interpreter(char *line, struct boss_state *boss);
/* Ask the user for command input and trigger processing of meta commands.
*/
static int prompt_for_command(struct boss_state *boss,
char *line, int line_size)
{
int l, ret;
char *line_res;
while (1) {
fprintf(stderr, "+++ Enter a command and its parameters :\n");
line_res = fgets(line, line_size - 1, stdin);
if (line_res == NULL)
return(0);
l = strlen(line);
if (l == 0) {
line[0] = '\n';
line[1] = 0;
} else if (line[l - 1] != '\n') {
line[l] = '\n';
line[l + 1] = 0;
}
/* Interpret meta commands which begin by @ */
ret = input_interpreter(line, boss);
if (ret == 0)
return(1);
if (ret < 0)
return(-1);
}
}
/* Transmit a command (which must end by white space, e.g. newline)
and its unique synchronization mark.
*/
static int transmit_command(struct boss_state *boss, char *line)
{
int ret;
char mark_line[32];
ret = write(boss->command_fd, line, strlen(line));
if (ret == -1) {
perror("write");
return(0);
}
/* Produce new unique -mark text to watch for */
(boss->mark_count)++;
sprintf(boss->pending_mark, "%d", boss->mark_count);
sprintf(mark_line, "-mark %s\n", boss->pending_mark);
ret = write(boss->command_fd, mark_line, strlen(mark_line));
if (ret == -1) {
perror("write");
return(0);
}
return(1);
}
/* Read reply messages from xorriso and wait for the expected synchronization
mark. Messages can be printed or collected in boss->reply_lines.
*/
static int await_all_replies(struct boss_state *boss)
{
int count, remainder = 0, ret;
char buf[32769], *line, *npt;
while (1) {
count = read(boss->reply_fd, buf + remainder,
sizeof(buf) - 1 - remainder);
if (count == -1) {
perror("read");
return(-1);
}
if (count == 0) {
fprintf(stderr, "+++ EOF encounterd by Master process\n");
return(-2);
}
for (npt = buf + remainder; npt < buf + count; npt++) {
if (*npt == 0) {
fprintf(stderr,
"+++ Protocol error : Reply contains 0-chars\n");
return(-1);
}
}
/* Split buf into lines */
buf[remainder + count] = 0; /* for convenience */
line = buf;
while (1) {
npt = strchr(line, '\n');
if (npt == NULL) {
/* Move line to start of buffer and set remainder */
if (line != buf) {
remainder = 0;
for (npt = line; *npt; npt++)
buf[remainder++] = *npt;
}
/* Now read more data in the hope to get a newline char */
break;
}
/* Interpret line */
*npt = 0;
if (line[0] == 'M') {
/* M-replies will be outdated until the pending command line
is completely done and the appended -mark command gets
into effect.
*/
if (strlen(line) < 6) {
fprintf(stderr,
"+++ Protocol error : M-channel line shorter than 6 chars\n");
return(-1);
}
if (strcmp(line + 5, boss->pending_mark) == 0) {
if ((line - buf) + strlen(line) + 1 < count) {
fprintf(stderr,
"+++ Protocol error : Surplus reply data after M-match\n");
fprintf(stderr, "%s\n", line + strlen(line) + 1);
return(-1);
}
return (1); /* Expected mark has arrived */
}
} else if (line[0] == 'R') {
/* R-replies are result lines of inquiry commands, like -ls.
They should be handled by specialized code which knows
how to parse and interpret them.
*/
if (boss->reply_lines_count < boss->reply_lines_size) {
ret = record_reply_line(boss, line);
if (ret <= 0)
return(ret);
} else
printf("%s\n", line);
} else {
/* I-replies are pacifiers, notifications, warnings, or
error messages. They should be handled by a general
message interpreter which determines their severity
and decides whether to bother the user.
*/
if (boss->reply_lines_count < boss->reply_lines_size) {
ret = record_reply_line(boss, line);
if (ret <= 0)
return(ret);
} else
fprintf(stderr, "%s\n", line);
}
/* Parse line and show words */
if (strlen(line) >= 5)
show_parsed(boss, line + 5);
line = npt + 1;
}
}
return(1);
}
/* Throw away I channel.
Unpack and reconstruct payload of R channel lines.
*/
static int de_pkt_result(struct boss_state *boss)
{
int i, l, w;
char *payload = NULL, *new_payload = NULL;
w = 0;
for (i = 0; i < boss->reply_lines_count; i++) {
if (boss->reply_lines[i][0] != 'R' ||
strlen(boss->reply_lines[i]) < 5)
continue;
if (payload == NULL) {
payload = strdup(boss->reply_lines[i] + 5);
} else {
l = strlen(payload);
new_payload = calloc(l + strlen(boss->reply_lines[i] + 5) + 1, 1);
if (new_payload == NULL)
goto no_mem;
strcpy(new_payload, payload);
strcpy(new_payload + l, boss->reply_lines[i] + 5);
free(payload);
payload = new_payload;
}
if (payload == NULL)
goto no_mem;
l = strlen(payload);
if (l > 0)
if (payload[l - 1] == '\n')
payload[l - 1] = 0;
if (boss->reply_lines[i][2] != '0') {
free(boss->reply_lines[w]);
boss->reply_lines[w] = payload;
w++;
payload = NULL;
}
}
for (i = w ; i < boss->reply_lines_count; i++) {
free(boss->reply_lines[i]);
boss->reply_lines[i] = NULL;
}
boss->reply_lines_count = w;
return(1);
no_mem:;
fprintf(stderr, "FATAL: Out of memory !\n");
return(-1);
}
/* Inquire and print all recorded message sieve results.
*/
static int drain_sieve(struct boss_state *boss)
{
int ret, i, j, names_size = 0, names_count = 0, first_result;
int number_of_strings, available, xorriso_ret, number_of_lines, k, r;
char **names = NULL, line[1024];
/* Install catcher for reply_lines */
ret = make_reply_lines(boss);
if (ret <= 0)
goto ex;
boss->reply_lines_size = Frontend_xorriso_max_resulT;
boss->reply_lines_count = 0;
/* Get list of filter rule names from -msg_op show_sieve */
ret = transmit_command(boss, "-msg_op show_sieve -\n");
if (ret <= 0)
goto ex;
ret = await_all_replies(boss);
if (ret <= 0)
goto ex;
ret = de_pkt_result(boss);
if (ret <= 0)
goto ex;
names = boss->reply_lines;
boss->reply_lines = NULL;
names_size = Frontend_xorriso_max_resulT;
names_count= boss->reply_lines_count;
ret = make_reply_lines(boss);
if (ret <= 0)
goto ex;
boss->reply_lines_size = Frontend_xorriso_max_resulT;
/* Inquire caught results of each name by -msg_op read_sieve
until return value is <= 0
*/
printf("--------------------------------------------------\n");
for (i = 0; i < names_count; i++) {
available = 1;
first_result = 1;
while (available > 0) {
boss->reply_lines_count = 0;
sprintf(line, "-msg_op read_sieve '%s'\n", names[i]);
ret = transmit_command(boss, line);
if (ret <= 0)
goto ex;
ret = await_all_replies(boss);
if (ret <= 0)
goto ex;
ret = de_pkt_result(boss);
if (ret <= 0)
goto ex;
if (boss->reply_lines_count < 2) {
fprintf(stderr, "drain_sieve: illegible result reply\n");
{ret= 0; goto ex;}
}
xorriso_ret = -1;
sscanf(boss->reply_lines[0], "%d", &xorriso_ret);
if(xorriso_ret <= 0)
break;
number_of_strings = -1;
sscanf(boss->reply_lines[1], "%d", &number_of_strings);
if(xorriso_ret < 0)
break;
if (first_result)
printf(" '%s' |\n", names[i]);
first_result = 0;
for (j = 0; names[i][j] != 0; j++)
printf("-");
printf("-----\n");
r = 2;
for (j = 0; j < number_of_strings && r < boss->reply_lines_count;
j++) {
number_of_lines = -1;
sscanf(boss->reply_lines[r], "%d", &number_of_lines);
r++;
printf("|");
for (k = 0; k < number_of_lines
&& r < boss->reply_lines_count; k++) {
printf("%s%s", boss->reply_lines[r],
k < number_of_lines - 1 ? "\n" : "");
r++;
}
printf("|\n");
}
}
if (first_result == 0)
printf("--------------------------------------------------\n");
}
/* Dispose all recorded results */
ret = transmit_command(boss, "-msg_op clear_sieve -\n");
if (ret <= 0)
goto ex;
ret = await_all_replies(boss);
if (ret <= 0)
goto ex;
ret = 1;
ex:;
/* Disable result catcher */
boss->reply_lines_size = 0;
if (names != NULL)
dispose_parsed_words(&names_size, &names);
return(ret);
}
/* ------------------------- Helpers of local helpers ---------------------- */
static int show_parsed(struct boss_state *boss, char *line)
{
int argc, ret = 0, i;
char **argv = NULL;
if (!boss->do_parse)
return(2);
ret = parse_line(boss->progname, line, boss->prefix, boss->separators,
boss->max_words, &argc, &argv, boss->flag);
if (ret <= 0 || argc <= 0)
return(0);
fprintf(stderr, "-----------------------------------------------------\n");
fprintf(stderr, "parse_line returns %d, argc = %d\n", ret, argc);
for (i = 0; i < argc; i++)
fprintf(stderr, "%2d : %s\n", i, argv[i]);
fprintf(stderr, "-----------------------------------------------------\n");
dispose_parsed_words(&argc, &argv); /* release memory */
return(1);
}
static int make_reply_lines(struct boss_state *boss)
{
int i;
if (boss->reply_lines != NULL)
return(1);
boss->reply_lines = calloc(Frontend_xorriso_max_resulT,
sizeof(char *));
if (boss->reply_lines == 0) {
fprintf(stderr, "FATAL: Out of memory !\n");
return(-1);
}
boss->reply_lines_count = 0;
boss->reply_lines_size = 0;
for (i = 0; i < Frontend_xorriso_max_resulT; i++)
boss->reply_lines[i] = NULL;
return(1);
}
static int record_reply_line(struct boss_state *boss, char *line)
{
if (boss->reply_lines[boss->reply_lines_count] != NULL)
free(boss->reply_lines[boss->reply_lines_count]);
boss->reply_lines[boss->reply_lines_count] = strdup(line);
if (boss->reply_lines[boss->reply_lines_count] == NULL) {
fprintf(stderr, "FATAL: Out of memory !\n");
return(-1);
}
boss->reply_lines_count++;
return(1);
}
static int input_interpreter(char *line, struct boss_state *boss)
{
int argc, ret = 0;
char **argv = NULL;
ret = parse_line(boss->progname, line, "", "", 6, &argc, &argv, 0);
if (ret <= 0 || argc <= 0)
return(0);
if (strcmp(argv[0], "@parse") == 0) {
boss->do_parse = 1;
boss->prefix[0] = 0;
if (argc > 1)
strcpy(boss->prefix, argv[1]);
boss->separators[0] = 0;
if (argc > 2)
strcpy(boss->separators, argv[2]);
boss->max_words = 0;
if (argc > 3)
sscanf(argv[3], "%d", &(boss->max_words));
boss->max_words = 0;
if (argc > 4)
sscanf(argv[4], "%d", &(boss->flag));
ret = 1;
} else if(strcmp(argv[0], "@noparse") == 0) {
boss->do_parse = 0;
ret = 1;
} else if(strcmp(argv[0], "@drain_sieve") == 0) {
ret= drain_sieve(boss);
} else {
ret = 0;
}
dispose_parsed_words(&argc, &argv); /* release memory */
return ret;
}
/* -------- Line-to-word parser equivalent to Xorriso_parse_line() -------- */
static int Sfile_sep_make_argv(char *progname, char *line, char *separators,
int max_words, int *argc, char ***argv, int flag);
int parse_line(char *progname, char *line,
char *prefix, char *separators, int max_words,
int *argc, char ***argv, int flag)
{
int ret, bsl_mode;
char *to_parse;
*argc = 0;
*argv = NULL;
to_parse = line;
bsl_mode = (flag >> 1) & 15;
if (prefix[0]) {
if (strncmp(line, prefix, strlen(prefix)) == 0) {
to_parse = line + strlen(prefix);
} else {
ret = 2; goto ex;
}
}
ret = Sfile_sep_make_argv(progname, to_parse, separators,
max_words, argc, argv,
(!(flag & 32)) | 4 | (bsl_mode << 5));
if (ret < 0) {
fprintf(stderr,
"%s : Severe lack of resources during command line parsing\n",
progname);
goto ex;
}
if (ret == 0) {
fprintf(stderr,
"%s : Incomplete quotation in %s line: %s\n",
progname, (flag & 32) ? "command" : "parsed", to_parse);
goto ex;
}
ex:;
if (ret <= 0)
Sfile_sep_make_argv("", "", "", 0, argc, argv, 2); /* release memory */
return(ret);
}
int dispose_parsed_words(int *argc, char ***argv)
{
Sfile_sep_make_argv("", "", "", 0, argc, argv, 2);
return(1);
}
/* -------------- Some helpers copied from xorriso/sfile.c ----------------- */
static int Sfile_destroy_argv(int *argc, char ***argv, int flag)
{
int i;
if(*argc>0 && *argv!=NULL){
for(i=0;i<*argc;i++){
if((*argv)[i]!=NULL)
free((*argv)[i]);
}
free((char *) *argv);
}
*argc= 0;
*argv= NULL;
return(1);
}
/* Converts backslash codes into single characters:
\a BEL 7 , \b BS 8 , \e ESC 27 , \f FF 12 , \n LF 10 , \r CR 13 ,
\t HT 9 , \v VT 11 , \\ \ 92
\[0-9][0-9][0-9] octal code , \x[0-9a-f][0-9a-f] hex code ,
\cX control-x (ascii(X)-64)
@param upto maximum number of characters to examine for backslash.
The scope of a backslash (0 to 3 characters) is not affected.
@param eaten returns the difference in length between input and output
@param flag bit0= only determine *eaten, do not convert
bit1= convert \000 to binary 0
*/
static int Sfile_bsl_interpreter(char *text, int upto, int *eaten, int flag)
{
char *rpt, *wpt, num_text[8], wdummy[8];
unsigned int num= 0;
*eaten= 0;
wpt= text;
for(rpt= text; *rpt != 0 && rpt - text < upto; rpt++) {
if(flag & 1)
wpt= wdummy;
if(*rpt == '\\') {
rpt++;
(*eaten)++;
if(*rpt == 'a') {
*(wpt++)= 7;
} else if(*rpt == 'b') {
*(wpt++)= 8;
} else if(*rpt == 'e') {
*(wpt++)= 27;
} else if(*rpt == 'f') {
*(wpt++)= 12;
} else if(*rpt == 'n') {
*(wpt++)= 10;
} else if(*rpt == 'r') {
*(wpt++)= 13;
} else if(*rpt == 't') {
*(wpt++)= 9;
} else if(*rpt == 'v') {
*(wpt++)= 11;
} else if(*rpt == '\\') {
*(wpt++)= '\\';
} else if(rpt[0] >= '0' && rpt[0] <= '7' &&
rpt[1] >= '0' && rpt[1] <= '7' &&
rpt[2] >= '0' && rpt[2] <= '7') {
num_text[0]= '0';
num_text[1]= *(rpt + 0);
num_text[2]= *(rpt + 1);
num_text[3]= *(rpt + 2);
num_text[4]= 0;
sscanf(num_text, "%o", &num);
if((num > 0 || (flag & 2)) && num <= 255) {
rpt+= 2;
(*eaten)+= 2;
*(wpt++)= num;
} else
goto not_a_code;
} else if(rpt[0] == 'x' &&
((rpt[1] >= '0' && rpt[1] <= '9') ||
(rpt[1] >= 'A' && rpt[1] <= 'F') ||
(rpt[1] >= 'a' && rpt[1] <= 'f'))
&&
((rpt[2] >= '0' && rpt[2] <= '9') ||
(rpt[2] >= 'A' && rpt[2] <= 'F') ||
(rpt[2] >= 'a' && rpt[2] <= 'f'))
) {
num_text[0]= *(rpt + 1);
num_text[1]= *(rpt + 2);
num_text[2]= 0;
sscanf(num_text, "%x", &num);
if(num > 0 && num <= 255) {
rpt+= 2;
(*eaten)+= 2;
*(wpt++)= num;
} else
goto not_a_code;
} else if(*rpt == 'c') {
if(rpt[1] > 64 && rpt[1] < 96) {
*(wpt++)= rpt[1] - 64;
rpt++;
(*eaten)++;
} else
goto not_a_code;
} else {
not_a_code:;
*(wpt++)= '\\';
rpt--;
(*eaten)--;
}
} else
*(wpt++)= *rpt;
}
*wpt= *rpt;
return(1);
}
#define SfileadrL 4096
static int Sfile_sep_make_argv(char *progname, char *line, char *separators,
int max_words, int *argc, char ***argv, int flag)
/*
bit0= read progname as first argument from line
bit1= just release argument list argv and return
bit2= abort with return(0) if incomplete quotes are found
bit3= eventually prepend missing '-' to first argument read from line
bit4= like bit2 but only check quote completeness, do not allocate memory
bit5+6= interpretation of backslashes:
0= no interpretation, leave unchanged
1= only inside double quotes
2= outside single quotes
3= everywhere
bit7= append a NULL element to argv
*/
{
int i,pass,maxl=0,l,argzaehl=0,bufl,line_start_argc, bsl_mode, ret= 0, eaten;
char *cpt,*start;
char *buf= NULL;
Sfile_destroy_argv(argc,argv,0);
if(flag&2)
{ret= 1; goto ex;}
if(flag & 16)
flag|= 4;
bsl_mode= (flag >> 5) & 3;
buf= calloc(strlen(line) + SfileadrL, 1);
if(buf == NULL)
{ret= -1; goto ex;}
for(pass=0;pass<2;pass++) {
cpt= line-1;
if(!(flag&1)){
argzaehl= line_start_argc= 1;
if(pass==0)
maxl= strlen(progname);
else
strcpy((*argv)[0],progname);
} else {
argzaehl= line_start_argc= 0;
if(pass==0) maxl= 0;
}
while(*(++cpt)!=0){
if(*separators) {
if(strchr(separators, *cpt) != NULL)
continue;
} else if(isspace(*cpt))
continue;
start= cpt;
buf[0]= 0;
cpt--;
if(max_words > 0 && argzaehl >= max_words && *cpt != 0) {
/* take uninterpreted up to the end */
cpt+= strlen(cpt) - 1;
}
while(*(++cpt)!=0) {
if(*separators) {
if(strchr(separators, *cpt) != NULL)
break;
} else if(isspace(*cpt))
break;
if(*cpt=='"'){
l= cpt-start; bufl= strlen(buf);
if(l>0) {
strncpy(buf + bufl, start, l); buf[bufl + l]= 0;
if(bsl_mode >= 3) {
ret= Sfile_bsl_interpreter(buf, l, &eaten, 0);
if(ret <= 0)
goto ex;
}
}
l= strlen(buf);
start= cpt+1;
while(*(++cpt)!=0) if(*cpt=='"') break;
if((flag&4) && *cpt==0)
{ret= 0; goto ex;}
l= cpt-start; bufl= strlen(buf);
if(l>0) {
strncpy(buf + bufl, start, l);
buf[bufl + l]= 0;
if(bsl_mode >= 1) {
ret= Sfile_bsl_interpreter(buf + bufl, l, &eaten, 0);
if(ret <= 0)
goto ex;
}
}
start= cpt+1;
}else if(*cpt=='\''){
l= cpt-start; bufl= strlen(buf);
if(l>0) {
strncpy(buf + bufl, start, l); buf[bufl + l]= 0;
if(bsl_mode >= 3) {
ret= Sfile_bsl_interpreter(buf, l, &eaten, 0);
if(ret <= 0)
goto ex;
}
}
l= strlen(buf);
start= cpt+1;
while(*(++cpt)!=0) if(*cpt=='\'') break;
if((flag&4) && *cpt==0)
{ret= 0; goto ex;}
l= cpt-start; bufl= strlen(buf);
if(l>0) {
strncat(buf,start,l);buf[bufl+l]= 0;
if(bsl_mode >= 2) {
ret= Sfile_bsl_interpreter(buf + bufl, l, &eaten, 0);
if(ret <= 0)
goto ex;
}
}
start= cpt+1;
}
if(*cpt==0) break;
}
l= cpt-start;
bufl= strlen(buf);
if(l>0) {
strncpy(buf + bufl, start, l); buf[bufl + l]= 0;
if(bsl_mode >= 3) {
ret= Sfile_bsl_interpreter(buf, l, &eaten, 0);
if(ret <= 0)
goto ex;
}
}
l= strlen(buf);
if(pass==0){
if(argzaehl==line_start_argc && (flag&8))
if(buf[0]!='-' && buf[0]!=0 && buf[0]!='#')
l++;
if(l>maxl) maxl= l;
}else{
strcpy((*argv)[argzaehl],buf);
if(argzaehl==line_start_argc && (flag&8))
if(buf[0]!='-' && buf[0]!=0 && buf[0]!='#')
sprintf((*argv)[argzaehl],"-%s", buf);
}
argzaehl++;
if(*cpt==0) break;
}
if(pass==0){
if(flag & 16)
{ret= 1; goto ex;}
*argc= argzaehl;
if(argzaehl>0 || (flag & 128)) {
*argv= (char **) calloc((argzaehl + !!(flag & 128)), sizeof(char *));
if(*argv==NULL)
{ret= -1; goto ex;}
}
for(i=0;i<*argc;i++) {
(*argv)[i]= (char *) calloc(maxl + 1, 1);
if((*argv)[i]==NULL)
{ret= -1; goto ex;}
}
if(flag & 128)
(*argv)[*argc]= NULL;
}
}
ret= 1;
ex:
if(buf != NULL)
free(buf);
return(ret);
}

View File

@ -0,0 +1,271 @@
#!/bin/sh
# Copyright (C) 2015 - 2016
# Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
# Provided under BSD license: Use, modify, and distribute as you like.
echo >&2
echo "frontend/grub-mkrescue-sed.sh manipulating xorriso arguments" >&2
echo >&2
# This script may be handed by its absolute path to grub-mkrescue
# via option --xorriso= . E.g.
#
# mkdir minimal
# touch minimal/empty-file.txt
# grub-mkrescue -o output.iso minimal \
# --xorriso=/home/thomas/xorriso-1.4.3./frontend/grub-mkrescue-sed.sh
#
# It will manipulate the xorriso arguments before they get executed by a
# xorriso program. Default is the neighboring ../../xorriso/xorriso program or,
# if that neighbor cannot be found, the system-wide installed xorriso.
#
# The mode "mjg" implements a layout which resembles Fedora LiveCD and Debian
# ISOs which are bootable by ISOLINUX for BIOS and GRUB2 for EFI.
# Its GPT is considered to be surplus, according to UEFI specs.
#
# The mode "mbr_only" implements an alternative layout according to UEFI 2.4,
# section 2.5.1 and table 16. No GTP, HFS+, or APM.
#
# The mode "mbr_hfs" is like "mbr_only" but with HFS+ mentioned in APM.
# It is still compliant to UEFI with no potentially deceiving GPT.
# If you add xorrisofs option -part_like_isohybrid then no gap fillig APM
# partition will emerge.
#
# These modes avoid duplicate storing of the EFI system partition "efi.img"
# by xorrisofs option -e "--interval:appended_partition_${partno}:all::"
# which is new to xorriso-1.4.3 with timestamp after 2015.12.30.175951.
# If "_copy" is appended to the mode name, then the file /efi.img will
# appear in the ISO 9660 filesystem and traditional -e "/efi.img" is used.
#
# "mbr_only_copy" is supposed to work with unmodified xorriso >= 1.3.2
#
# Variation settings
#
# The environment variables MKRESCUE_SED_* override the following
# default settings:
# Manipulation mode:
# "mjg" = ESP in MBR+GPT+APM, with HFS+
# "mbr_only" = ESP in MBR, without HFS+
# "mbr_hfs" = ESP in MBR, HFS+ in APM
# $mode"_copy" = one of above modes, ESP in ISO and as appended partition
# "original" = pass arguments unchanged
mode="mjg"
if test -n "$MKRESCUE_SED_MODE"
then
mode="$MKRESCUE_SED_MODE"
fi
# First argument of -append_partition with mode "mjg". Values: 1 or 2.
partno=1
if test -n "$MKRESCUE_SED_PARTNO"
then
partno="$MKRESCUE_SED_PARTNO"
fi
# Replacement for option --protective-msdos-label. Either itself or empty text.
# If the environment variable contains the word "no", this means empty.
protective="--protective-msdos-label"
if test -n "$MKRESCUE_SED_PROTECTIVE"
then
if test x"$MKRESCUE_SED_PROTECTIVE" = xno
then
protective=""
elif test x"$MKRESCUE_SED_PROTECTIVE" = xyes
then
protective="--protective-msdos-label"
else
protective="$MKRESCUE_SED_PROTECTIVE"
fi
fi
# "yes" shows xorriso arguments, "extra" additionally shows all input files.
debug=no
if test -n "$MKRESCUE_SED_DEBUG"
then
debug="$MKRESCUE_SED_DEBUG"
fi
# The path to the program that will be executed with the converted arguments.
if test -n "$MKRESCUE_SED_XORRISO"
then
xorriso="$MKRESCUE_SED_XORRISO"
else
# Prefer neighboring xorriso binary over system-wide installed one.
self_dir="$(dirname $(dirname "$0") )"
if test -x "$self_dir"/xorriso/xorriso
then
xorriso="$self_dir"/xorriso/xorriso
else
xorriso="xorriso"
fi
fi
# MKRESCUE_SED_XORRISO_ARGS will be used as first arguments of the xorriso run.
# (Trailing xorriso arguments may be simply added to the grub-mkrescue
# command line.)
# Each argument must be a single word. No whitespace. No quotation marks.
#
# Do the work
#
# grub-mkrescue inquires features by running these arguments
if test "$*" = "-as mkisofs -help"
then
"$xorriso" "$@"
exit $?
fi
echo "frontend/grub-mkrescue-sed.sh mode: $mode" >&2
echo >&2
if test x"$debug" = xyes -o x"$debug" = xextra
then
# Show arguments
echo "##### Begin of received arguments" >&2
echo "$0" >&2
for i in "$@"
do
echo "$i" >&2
done
echo "##### End of received arguments" >&2
echo >&2
fi
# Look for the name of the /tmp directory with the GRUB2 files.
# It is the next argument after -r. But as default accept any /tmp/grub.*
next_is_dir=0
dir="."
for i in "$@"
do
if test x"$i" = x"-r"
then
next_is_dir=1
elif test $next_is_dir = 1
then
next_is_dir=0
if echo "$i" | grep '^/tmp/grub.' >/dev/null 2>&1
then
test -d "$i" && dir="$i"
fi
elif test "$dir" = "."
then
if echo "$i" | grep '^/tmp/grub.' >/dev/null 2>&1
then
test -d "$i" && dir="$i"
fi
fi
done
if test x"$debug" = xextra
then
# Show files on disk
find "$dir"
fi
efi_tmp_name=
if test x"$mode" = xmjg
then
# Exchange arguments for the experimental GRUB2 mjg layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition $partno 0xef \/tmp\/$efi_tmp_name/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_${partno}:all:: -no-emul-boot -isohybrid-gpt-basdat/" \
-e "s/--protective-msdos-label/$protective -part_like_isohybrid/" \
)
elif test x"$mode" = xmjg_copy
then
# Exchange arguments for the experimental GRUB2 mjg layout
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition $partno 0xef \/tmp\/$(basename "$dir")\/efi.img/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e efi.img -no-emul-boot -isohybrid-gpt-basdat/" \
-e "s/--protective-msdos-label/$protective -part_like_isohybrid/" \
)
elif test x"$mode" = xmbr_only
then
# Exchange arguments for no-HFS MBR-only layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
-e "s/--protective-msdos-label/$protective/" \
)
elif test x"$mode" = xmbr_only_copy
then
# Exchange arguments for no-HFS MBR-only layout
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$(basename "$dir")\/efi.img/" \
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
-e "s/--protective-msdos-label/$protective/" \
)
elif test x"$mode" = xmbr_hfs
then
# Exchange arguments for MBR and HFS+ layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \
-e "s/--protective-msdos-label/$protective/" \
)
elif test x"$mode" = xmbr_hfs_copy
then
# Exchange arguments for MBR and HFS+ layout
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$(basename "$dir")\/efi.img/" \
-e "s/--protective-msdos-label/$protective/" \
)
elif test x"$mode" = xoriginal
then
# Pass arguments unchanged
x=" $*"
else
echo >&2
echo "$0 : FATAL : Unknown manipulation mode '$mode'." >&2
echo >&2
exit 1
fi
if test x"$debug" = xyes -o x"$debug" = xextra
then
echo "+ converted xorriso arguments:" >&2
echo " $x" >&2
echo >&2
fi
# Run xorriso binary with the converted arguments
use_gdb=no
if test "$use_gdb" = yes
then
gdb_file=/tmp/grub-mkrescue-sed-gdb
echo b assess_appended_gpt >$gdb_file
echo run $MKRESCUE_SED_XORRISO_ARGS $x >>$gdb_file
gdb -x $gdb_file "$xorriso"
ret=0
else
"$xorriso" $MKRESCUE_SED_XORRISO_ARGS $x
ret=$?
fi
# Move back the ESP if it was separated
if test -n "$efi_tmp_name" -a -e /tmp/$efi_tmp_name
then
mv /tmp/$efi_tmp_name "$dir"/efi.img
fi
exit $ret

View File

@ -0,0 +1,304 @@
#!/bin/bash
#
# Demo of a shell frontend that communicates with a xorriso slave via
# two named pipes.
#
# This script creates two named pipes and starts xorriso with command
# -named_pipes_loop cleanup /tmp/xorriso_stdin_pipe_$$ xorriso_stdin_pipe_$$ -
# Its main loop prompts the user for commands, sends them to xorriso,
# receives the replies, and parses them by xorriso command
# -msg_op parse_silently. The resulting words are printed to stdout.
#
# xorriso removes the two pipes when it finishes execution of -named_pipes_loop
# regularly. (E.g. because of commands -end or -rollback_end or because of
# name loop control message "end_named_pipe_loop".)
# The vanishing of the pipe files tells this script that xorriso is gone.
#
#
# Copyright (C) 2013
# Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
# Provided under BSD license: Use, modify, and distribute as you like.
#
# What xorriso program to use
xorriso=xorriso
if test o"$1" = o"-xorriso"
then
xorriso="$2"
fi
# Version of xorriso and minimum requirement by this script
export xorriso_version=
export xorriso_version_req=1.3.1
# Info about the xorriso slave process
export xorriso_is_running=0
export xorriso_pid=0
export xorriso_will_end=0
# Will be set to 1 before this script ends normally
export normal_end=0
# ---------------- An interpreter for quoted xorriso replies ----------------
# xorriso commands like -lsl wrap filenames into quotation marks in order
# to unambigously represent any character byte except the 0-byte.
# This piece of code parses input strings into words by letting xorriso
# command -msg_op "parse_silently" do the hard work.
# The input strings should be composed by concatenating input lines with
# newline characters between them. Begin by submitting a single line (without
# newline at its end) and retry with an appended further line, if
# xorriso_parse
# returns 1. See below xorriso_cmd_and_handle_result() for an example.
# The parsed reply words.
# Valid are reply_array[0] to reply_array[reply_count-1)]
export reply_array
export reply_count
# Interpret reply of -msg_op parse
xorriso_recv_parse_reply() {
reply_count=0
unset reply_array
export reply_array
ret=-1
read ret
if test "$ret" -lt 0 -o -z "$ret"
then
echo "Unexpected text as first reply line of -msg_op parse" >&2
xorriso_is_running=0
return 2
fi
test "$ret" = 0 && return "1"
read num_strings
string_count=0
while true
do
test "$string_count" -ge "$num_strings" && break
read num_lines
line_count=0
acc=
while true
do
test "$line_count" -ge "$num_lines" && break
read line
test "$line_count" -gt 0 && acc="$acc"$'\n'
acc="$acc""$line"
line_count=$(($line_count + 1))
done
reply_array["$string_count"]="$acc"
string_count=$(($string_count + 1))
done
reply_count="$num_strings"
return 0
}
# Parse a quoted multi-line string into words
xorriso_parse() {
# $1 : The string which shall be parsed
# $2 : The number of concatenated input lines (= number of newlines + 1)
# return: 0= array is valid , 1= line incomplete , 2= other error
test "$xorriso_is_running" = 0 && return 1
xorriso_send_cmd "msg_op parse_silently "'"'"'' '' 0 0 $2"'"'$'\n'"$1" || \
return 2
xorriso_recv_parse_reply <"$result_pipe" || xorriso_is_running=0
ret=$?
test "$xorriso_is_running" = 0 && ret=2
return "$ret"
}
# ------------- End of interpreter for quoted xorriso replies --------------
# Send one or more command lines to xorriso
xorriso_send_cmd() {
# $1 : the lines to send
# >>> is it possible to have a timeout on echo ?
if test -p "$cmd_pipe"
then
echo -E "$1" >"$cmd_pipe"
else
xorriso_is_running=0
return 1
fi
}
# Make filenames safe for transport by wrapping them in quotes and
# escaping quotes in their text
xorriso_esc() {
echo -n "'"
echo -n "$1" | sed -e "s/'/'"'"'"'"'"'"'/g"
echo -n "'"
}
# A handler function for xorriso_cmd_and_handle_result
xorriso_reply_to_stdout() {
echo "${reply_array[*]}"
}
# Let a handler inspect the result lines of a xorriso command line
xorriso_cmd_and_handle_result() {
# $1: handler command word and possibly argument words
# $2: command line for xorriso
if test "$xorriso_is_running" = 0
then
return 1
fi
handler="$1"
xorriso_send_cmd "$2" || return 1
res=$(cat "$result_pipe")
ret=$?
if test "$xorriso_will_end" = 1 -o "$xorriso_is_running" = 0 -o "$ret" -ne 0
then
test -n "$res" && echo -n "$res"
xorriso_is_running=0
test "$ret" = 0 || return 1
return 0
fi
test -z "$res" && return 0
echo "$res" | \
while read line
do
line_count=1
while true
do
xorriso_parse "$line" "$line_count"
ret=$?
test "$ret" = 0 && break
if test "$ret" = 2
then
return 1
fi
read addon
line="$line"$'\n'"$addon"
line_count=$(expr "$line_count" + 1)
done
# One can now make use of reply_array[0...(reply_count-1)]
$handler
done
return 0
}
# Execute -version and let xorriso_version_handler interpret reply
xorriso_check_version() {
lookfor='^xorriso version : '
xorriso_version=$("$xorriso" -version 2>/dev/null | grep "$lookfor" | \
sed -e "s/${lookfor}//")
ret=$?
if test "$ret" -ne 0 -o "$xorriso_version" = ""
then
echo "SORRY: Program run '${xorriso}' -version did not yield a result." >&2
echo >&2
exit 2
fi
smallest=$((echo "$xorriso_version_req" ; echo "$xorriso_version" ) | \
sort | head -1)
test "$smallest" = "$xorriso_version_req" && return 0
echo "SORRY: xorriso version too old: ${xorriso_version} . Need at least xorriso-${xorriso_version_req} ." >&2
echo >&2
exit 2
}
# To be executed on exit
xorriso_cleanup() {
send_end_cmd=0
if test -p "$cmd_pipe" -a "$xorriso_is_running" = 1
then
if test "$normal_end" = 0
then
echo "Checking whether xorriso is still running ..." >&2
set -x
# Give xorriso time to abort
sleep 1
if ps | grep '^'"$xorriso_pid" >/dev/null
then
# >>> try to further confirm xorriso identity
send_end_cmd=1
fi
else
send_end_cmd=1
fi
fi
test "$normal_end" = 0 && set -x
if test "$send_end_cmd" = 1
then
echo "Sending xorriso an -end command ..." >&2
xorriso_send_cmd "end" && \
test -p "$result_pipe" && cat "$result_pipe" >/dev/null
fi
test -p "$cmd_pipe" && rm "$cmd_pipe"
test -p "$result_pipe" && rm "$result_pipe"
}
# ---------------------------------- main ---------------------------------
# Choose pipe names
export cmd_pipe=/tmp/xorriso_stdin_pipe_$$
export result_pipe=/tmp/xorriso_stdout_pipe_$$
# Check the program whether it is modern enough
xorriso_check_version "$xorriso"
# Prepare for then end of this script
trap xorriso_cleanup EXIT
# Create the pipes and start xorriso
mknod "$cmd_pipe" p
mknod "$result_pipe" p
"$xorriso" -abort_on NEVER -for_backup \
-named_pipe_loop cleanup:buffered "$cmd_pipe" "$result_pipe" "-" &
xorriso_pid=$!
xorriso_is_running=1
# Get a sign of life from xorriso before issuing the loop prompt
xorriso_cmd_and_handle_result xorriso_reply_to_stdout \
"print_info 'xorriso process ${xorriso_pid} started by $0'"
echo >&2
# Now get commands from the user, send them to xorriso and display them
# via the simple handler xorriso_reply_to_stdout()
while test "$xorriso_is_running" = 1
do
if test -p "$cmd_pipe"
then
echo -n "xorriso> " >&2
else
echo "$0 : Lost contact to xorriso process $xorriso_pid" >&2
xorriso_is_running=0
break
fi
read line
if echo "$line" | grep '^-*end$' >/dev/null
then
break
fi
if echo "$line" | grep '^-*rollback_end$' >/dev/null
then
xorriso_will_end=1
fi
xorriso_cmd_and_handle_result xorriso_reply_to_stdout "$line"
done
# Prevent set -x in the exit handler
normal_end=1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,222 @@
#!/bin/sh
# Copyright (C) 2015
# Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
# Provided under BSD license: Use, modify, and distribute as you like.
# set -x
# ---------------------------- functions ---------------------------
usage() {
echo >&2
echo "usage: $0 "'\' >&2
echo " [-xorriso path] id_string [-dev] iso_adr [xorriso_arguments ...]" >&2
echo >&2
echo " This script looks for named pipe" >&2
echo ' /tmp/xorriso_stdin_pipe_${id_string}' >&2
echo " which is supposed to be connected to a xorriso process." >&2
echo " If not found, the stdin pipe and a stdout pipe get created" >&2
echo " and a xorriso dialog process gets started and connected." >&2
echo " Each character in id_string must match [-+:.,=@0-9A-Za-z]." >&2
echo " If iso_adr differs from the previous run with the same id_string," >&2
echo " then any changes on the previous ISO are committed as session" >&2
echo " before command -dev is performed to load the meta data of" >&2
echo " the newly addressed ISO." >&2
echo " After this is done, the optionally given xorriso_arguments" >&2
echo " are written into the stdin pipe from where xorriso will read" >&2
echo " them as commands and their parameters." >&2
echo >&2
}
# Make filenames safe for transport by wrapping them in quotes and
# escaping quotes in their text
xorriso_esc() {
echo -n "'"
echo -n "$1" | sed -e "s/'/'"'"'"'"'"'"'/g"
echo -n "'"
}
# Send one or more command lines to xorriso
xorriso_send_cmd() {
# $1 : the lines to send
# >>> is it possible to have a timeout on echo ?
if test -p "$cmd_pipe"
then
echo " $1" >"$cmd_pipe"
else
xorriso_is_running=0
return 1
fi
}
# Send command and wait for answer
xorriso_cmd_and_result() {
# $1: command line for xorriso
# $2: if not empty, grep expression for stdout
if test "$xorriso_is_running" = 0
then
return 1
fi
xorriso_send_cmd "$1" || return 1
if test -n "$2"
then
cat "$result_pipe"
else
grep "$2" <"$result_pipe"
fi
return 0
}
# ------------------------------- main -----------------------------
# Argument interpreter
if test "$#" -lt 2
then
usage "$0"
exit 1
fi
xorriso=xorriso
if test o"$1" = o"-xorriso"
then
xorriso="$2"
shift 2
fi
export xorriso_is_running=0
if test "$#" -lt 2
then
usage "$0"
exit 1
fi
id_string=$(echo "$1" | sed -e 's/[^-+:.,=@0-9A-Za-z]/_/g' )
shift 1
# Ignore second argument -dev
if test o"$1" = o"-dev"
then
shift 1
if test "$#" -lt 1
then
usage "$0"
exit 1
fi
fi
device="$1"
shift 1
# Perform the action
export cmd_pipe=/tmp/xorriso_stdin_pipe_$id_string
export result_pipe=/tmp/xorriso_stdout_pipe_$id_string
if test -p "$cmd_pipe"
then
xorriso_is_running=1
else
xorriso_is_running=0
fi
if test "$xorriso_is_running" = "0"
then
# xorriso is not started yet
# Check for xorriso version which knows command -named_pipe_loop
echo "Checking xorriso version ..." >&2
xorriso_version_req="1.3.2"
version=$("$xorriso" -version | grep '^xorriso version' |
sed -e 's/^xorriso version : //')
smallest=$( (echo "$xorriso_version_req" ; echo "$version" ) | \
sort | head -1)
if test "$smallest" = "$xorriso_version_req"
then
dummy=dummy
else
echo "$0 : FATAL : Need xorriso version >= $xorriso_version_req" >&2
echo "Found version: $version" >&2
exit 2
fi
if mknod "$cmd_pipe" p
then
echo "Created named pipe for xorriso commands: $cmd_pipe" >&2
else
echo "Failed to create named pipe for xorriso commands: $cmd_pipe" >&2
exit 3
fi
if mknod "$result_pipe" p
then
echo "Created named pipe for xorriso result channel: $result_pipe" >&2
else
echo \
"Failed to create named pipe for xorriso result channel: $result_pipe" >&2
if rm "$cmd_pipe"
then
echo "Removed named pipe for xorriso commands: $cmd_pipe" >&2
fi
exit 3
fi
echo "Starting xorriso process ..." >&2
"$xorriso" -abort_on NEVER -for_backup \
-named_pipe_loop cleanup:buffered "$cmd_pipe" "$result_pipe" "-" \
>&2 &
# (stdout is redirected to stderr, in order not to keep a pipe waiting for
# input from the still open stdout copy of the background process.
# -named_pipe_loop will disconnect xorriso result channel from stdout.)
xorriso_is_running=1
fi
# Inquire current xorriso -dev
xorriso_device=$(xorriso_cmd_and_result "-status -dev" "^-dev" | \
sed -e 's/^-dev //')
if echo " $device" | grep "^ '" >/dev/null
then
quoted="$device"
else
quoted=$(xorriso_esc "$device")
fi
if test "$xorriso_device" = "$quoted"
then
dummy=dummy
else
# Inquire the need for a -commit command
pending=$(xorriso_cmd_and_result "-changes_pending show_status" \
"^-changes_pending" \
| sed -e 's/^-changes_pending //')
if test "$pending" = "yes"
then
if xorriso_cmd_and_result "-commit"
then
dummy=dummy
else
exit 1
fi
fi
# Now change ISO filesystem
if xorriso_cmd_and_result "-dev $device"
then
xorriso_device="$device"
else
exit 1
fi
fi
test "$*" = "" && exit 0
if xorriso_cmd_and_result "$*"
then
dummy=dummy
else
exit 1
fi
exit 0

View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libisoburn
Description: Multi-session filesystem extension to libisofs, libburn.
Version: @VERSION@
Requires:
Libs: -L${libdir} -lisoburn
Cflags: -I${includedir}/libisoburn

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,370 @@
/*
data source for libisoburn.
Copyright 2007 - 2012 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifndef Xorriso_standalonE
#include <libburn/libburn.h>
#include <libisofs/libisofs.h>
#else /* ! Xorriso_standalonE */
#include "../libisofs/libisofs.h"
#include "../libburn/libburn.h"
#endif /* Xorriso_standalonE */
#include "isoburn.h"
/* Cached reading of image tree data by multiple tiles */
/* Debugging only: This reports cache loads on stderr.
#define Libisoburn_read_cache_reporT 1
*/
struct isoburn_cache_tile {
char *cache_data;
uint32_t cache_lba;
uint32_t last_error_lba;
uint32_t last_aligned_error_lba;
int cache_hits;
int age;
};
struct isoburn_cached_drive {
struct burn_drive *drive;
struct isoburn_cache_tile **tiles;
int num_tiles;
int tile_blocks;
int current_age;
/**
Offset to be applied to all block addresses to compensate for an
eventual displacement of the block addresses relative to the image
start block address that was assumed when the image was created.
E.g. if track number 2 gets copied into a disk file and shall then
be loaded as ISO filesystem.
If displacement_sign is 1 then the displacement number will be
added to .read_block() addresses, if -1 it will be subtracted.
Else it will be ignored.
*/
uint32_t displacement;
int displacement_sign;
};
#define Libisoburn_max_agE 2000000000
static int ds_inc_age(struct isoburn_cached_drive *icd, int idx, int flag);
int ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
{
int ret, i, oldest, oldest_age;
struct burn_drive *d;
off_t count;
uint32_t aligned_lba;
char msg[80];
struct isoburn_cache_tile **tiles;
struct isoburn_cached_drive *icd;
if(src == NULL || buffer == NULL)
/* It is not required by the specs of libisofs but implicitly assumed
by its current implementation that a data source read result <0 is
a valid libisofs error code.
*/
return ISO_NULL_POINTER;
icd = (struct isoburn_cached_drive *) src->data;
d = (struct burn_drive*) icd->drive;
if(d == NULL) {
/* This would happen if libisoburn saw output data in the fifo and
performed early drive release and afterwards libisofs still tries
to read data.
That would constitute a bad conceptual problem in libisoburn.
*/
isoburn_msgs_submit(NULL, 0x00060000,
"Programming error: Drive released while libisofs still attempts to read",
0, "FATAL", 0);
return ISO_ASSERT_FAILURE;
}
tiles = icd->tiles;
if(icd->displacement_sign == 1) {
if(lba + icd->displacement < lba) {
address_rollover:;
return ISO_DISPLACE_ROLLOVER;
} else
lba += icd->displacement;
} else if(icd->displacement_sign == -1) {
if(lba < icd->displacement )
goto address_rollover;
else
lba -= icd->displacement;
}
aligned_lba= lba & ~(icd->tile_blocks - 1);
for (i = 0; i < icd->num_tiles; i++) {
if(aligned_lba == tiles[i]->cache_lba &&
tiles[i]->cache_lba != 0xffffffff) {
(tiles[i]->cache_hits)++;
memcpy(buffer, tiles[i]->cache_data + (lba - aligned_lba) * 2048, 2048);
count= 2048;
ds_inc_age(icd, i, 0);
return 1;
}
}
/* find oldest tile */
oldest_age= Libisoburn_max_agE;
oldest= 0;
for(i = 0; i < icd->num_tiles; i++) {
if(tiles[i]->cache_lba == 0xffffffff) {
oldest= i;
break;
}
if(tiles[i]->age < oldest_age) {
oldest_age= tiles[i]->age;
oldest= i;
}
}
tiles[oldest]->cache_lba= 0xffffffff; /* invalidate cache */
if(tiles[oldest]->last_aligned_error_lba == aligned_lba) {
ret = 0;
} else {
ret = burn_read_data(d, (off_t) aligned_lba * (off_t) 2048,
(char *) tiles[oldest]->cache_data,
icd->tile_blocks * 2048, &count, 2);
}
if (ret <= 0 ) {
tiles[oldest]->last_aligned_error_lba = aligned_lba;
/* Read-ahead failure ? Try to read 2048 directly. */
if(tiles[oldest]->last_error_lba == lba)
ret = 0;
else
ret = burn_read_data(d, (off_t) lba * (off_t) 2048, (char *) buffer,
2048, &count, 0);
if (ret > 0)
return 1;
tiles[oldest]->last_error_lba = lba;
sprintf(msg, "ds_read_block(%lu) returns %lX",
(unsigned long) lba, (unsigned long) ret);
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "DEBUG", 0);
return ISO_DATA_SOURCE_MISHAP;
}
#ifdef Libisoburn_read_cache_reporT
fprintf(stderr, "Tile %2.2d : After %3d hits, new load from %8x , count= %d\n",
oldest, tiles[oldest]->cache_hits, aligned_lba, (int) count);
#endif
tiles[oldest]->cache_lba= aligned_lba;
tiles[oldest]->cache_hits= 1;
ds_inc_age(icd, oldest, 0);
memcpy(buffer, tiles[oldest]->cache_data + (lba - aligned_lba) * 2048, 2048);
count= 2048;
return 1;
}
static int ds_open(IsoDataSource *src)
{
/* nothing to do, device is always grabbed */
return 1;
}
static int ds_close(IsoDataSource *src)
{
/* nothing to do, device is always grabbed */
return 1;
}
static int isoburn_cache_tile_destroy(struct isoburn_cache_tile **o,
int flag)
{
if (*o == NULL)
return(0);
if ((*o)->cache_data != NULL)
free((*o)->cache_data);
free(*o);
*o = NULL;
return(1);
}
static int isoburn_cache_tile_new(struct isoburn_cache_tile **o,
int tile_blocks, int flag)
{
struct isoburn_cache_tile *t;
*o = t = calloc(1, sizeof(struct isoburn_cache_tile));
if (t == NULL)
goto fail;
t->cache_data = NULL;
t->cache_lba = 0xffffffff;
t->cache_hits = 0;
t->last_error_lba = 0xffffffff;
t->last_aligned_error_lba = 0xffffffff;
t->age= 0;
t->cache_data = calloc(1, tile_blocks * 2048);
if (t->cache_data == NULL)
goto fail;
return(1);
fail:;
isoburn_cache_tile_destroy(o, 0);
return(-1);
}
static int isoburn_cached_drive_destroy(struct isoburn_cached_drive **o,
int flag)
{
struct isoburn_cached_drive *c;
int i;
if (*o == NULL)
return(0);
c= *o;
if (c->tiles != NULL) {
for (i = 0; i < c->num_tiles; i++)
isoburn_cache_tile_destroy(&(c->tiles[i]), 0);
free(c->tiles);
}
free(c);
*o= NULL;
return(1);
}
static int isoburn_cached_drive_new(struct isoburn_cached_drive **o,
struct burn_drive *d, int cache_tiles,
int tile_blocks, int flag)
{
struct isoburn_cached_drive *icd;
int i, ret;
*o = icd = calloc(1,sizeof(struct isoburn_cached_drive));
if (*o == NULL)
return(-1);
icd->drive = d;
icd->tiles = NULL;
icd->num_tiles = cache_tiles;
icd->tile_blocks = tile_blocks;
icd->current_age = 0;
icd->displacement = 0;
icd->displacement_sign = 0;
icd->tiles = calloc(1, sizeof(struct isoburn_cache_tile *) * icd->num_tiles);
if (icd->tiles == NULL)
goto fail;
for (i = 0; i < icd->num_tiles; i++) {
ret = isoburn_cache_tile_new(&(icd->tiles[i]), icd->tile_blocks, 0);
if (ret <= 0)
goto fail;
}
return(1);
fail:;
isoburn_cached_drive_destroy(o, 0);
return(-1);
}
static void ds_free_data(IsoDataSource *src)
{
struct isoburn_cached_drive *icd;
if(src->data != NULL) {
icd= (struct isoburn_cached_drive *) src->data;
isoburn_cached_drive_destroy(&icd, 0);
}
src->data= NULL;
}
int isoburn_data_source_shutdown(IsoDataSource *src, int flag)
{
struct isoburn_cached_drive *icd;
if(src==NULL)
return(0);
icd= (struct isoburn_cached_drive *) src->data;
icd->drive= NULL;
return(1);
}
IsoDataSource *isoburn_data_source_new(struct burn_drive *d,
uint32_t displacement, int displacement_sign,
int cache_tiles, int tile_blocks)
{
IsoDataSource *src;
struct isoburn_cached_drive *icd= NULL;
int ret;
if (d==NULL)
return NULL;
src = malloc(sizeof(IsoDataSource));
if (src == NULL)
return NULL;
ret = isoburn_cached_drive_new(&icd, d, cache_tiles, tile_blocks, 0);
if (ret <= 0) {
free(src);
return NULL;
}
src->version = 0;
src->refcount = 1;
src->read_block = ds_read_block;
src->open = ds_open;
src->close = ds_close;
src->free_data = ds_free_data;
src->data = icd;
icd->displacement = displacement;
icd->displacement_sign = displacement_sign;
return src;
}
static int ds_inc_age(struct isoburn_cached_drive *icd, int idx, int flag)
{
int i;
(icd->current_age)++;
if(icd->current_age>=Libisoburn_max_agE) { /* reset all ages (allow waste) */
for(i = 0; i < icd->num_tiles; i++)
(icd->tiles)[i]->age= 0;
icd->current_age= 1;
}
(icd->tiles)[idx]->age= icd->current_age;
return(1);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,818 @@
/*
Class struct of libisoburn.
Copyright 2007 - 2016 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
#ifndef Isoburn_includeD
#define Isoburn_includeD
/* for uint8_t */
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#endif
/* For emulated TOC of overwriteable media.
Provides minimal info for faking a struct burn_toc_entry.
*/
struct isoburn_toc_entry {
int session;
int track_no; /* point */
int start_lba;
int track_blocks;
char *volid; /* For caching a volume id from emulated toc on overwriteables */
struct isoburn_toc_entry *next;
};
int isoburn_toc_entry_new(struct isoburn_toc_entry **objpt,
struct isoburn_toc_entry *boss, int flag);
/* @param flag bit0= delete all subordinates too
*/
int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag);
/* Minimal size of target_iso_head which is to be written during
isoburn_activate_session().
Within this size there is everything that is needed for image access with
no partition offset. The actual target_iso_head buffer must be larger by
the evential partition offset.
*/
#define Libisoburn_target_head_sizE (32*2048)
/* Maximum number of appended partitions. Effectively usable number depends
on system area type.
*/
#define Libisoburn_max_appended_partitionS 8
/*
Maximum length of a disc label text plus 1.
*/
#define Libisoburn_disc_label_sizE 129
struct isoburn {
/* The libburn drive to which this isoburn object is related
Most isoburn calls will use a burn_drive as object handle */
struct burn_drive *drive;
/* -1= inappropriate medium state detected
0= libburn multi-session medium, resp. undecided yet
1= random access medium */
int emulation_mode;
/* Although rarely used, libburn can operate on several
drives simultaneously. */
struct isoburn *prev;
struct isoburn *next;
/* If >= 0, this address is used as reply for isoburn_disc_get_msc1()
*/
int fabricated_msc1;
/* If >= 0, this address is used in isoburn_disc_track_lba_nwa()
as reply parameter nwa.
(The other nwa parameters below apply only to the effective write address
on random access media. msc2 is handed to libisofs but not to libburn.)
*/
int fabricated_msc2;
/* The nwa to be used for a first session on the present kind of overwriteable
media (usually Libisoburn_overwriteable_starT, but might be forced to 0)
*/
int zero_nwa;
/* Start address as given by image examination (bytes, not blocks) */
off_t min_start_byte;
/* Aligned start address to be used for processing (counted in blocks) */
int nwa;
/* Truncate to .nwa an eventual regular file serving as output drive */
int truncate;
/* Eventual freely fabricated isoburn_disc_get_status().
BURN_DISC_UNREADY means that this variable is disabled
and normally emulated status is in effect.
*/
enum burn_disc_status fabricated_disc_status;
/* To be set if read errors occurred during media evaluation.
*/
int media_read_error;
/* Eventual emulated table of content read from the chain of ISO headers
on overwriteable media.
*/
struct isoburn_toc_entry *toc;
/* Indicator wether the most recent burn run worked :
-1 = undetermined, ask libburn , 0 = failure , 1 = success
To be inquired by isoburn_drive_wrote_well()
*/
int wrote_well;
/* ISO head buffer to be filled by write run */
int target_iso_head_size;
uint8_t *target_iso_head;
/* The 2k offset which was read from a loaded image.
*/
uint32_t loaded_partition_offset;
/* Libisofs image context */
IsoImage *image;
/* The start LBA of the image */
int image_start_lba;
/* The block data source from which the existing image is read.
*/
IsoDataSource *iso_data_source;
/* The burn source which transfers data from libisofs to libburn.
It has its own fifo.
*/
struct burn_source *iso_source;
/* For iso_tree_set_report_callback() */
int (*read_pacifier)(IsoImage*, IsoFileSource*);
/* For iso_image_attach_data() */
void *read_pacifier_handle;
/* An application provided method to immediately deliver messages */
int (*msgs_submit)(void *handle, int error_code, char msg_text[],
int os_errno, char severity[], int flag);
void *msgs_submit_handle; /* specific to application method */
int msgs_submit_flag; /* specific to application method */
/* Forwarding an image generation option to the burn wrapper */
int do_tao;
/* Forwarding an image generation option to the burn wrapper */
int do_fsync;
};
/* Creation and disposal function */
int isoburn_new(struct isoburn **objpt, int flag);
int isoburn_destroy(struct isoburn **objpt, int flag);
/* Eventual readers for public attributes */
/* ( put into separate .h file then ) */
int isoburn_get_emulation_mode(struct isoburn *o, int *pt, int flag);
int isoburn_get_target_volset(struct isoburn *o, IsoImage **pt, int flag);
/* List management */
int isoburn_get_prev(struct isoburn *o, struct isoburn **pt, int flag);
int isoburn_get_next(struct isoburn *o, struct isoburn **pt, int flag);
int isoburn_destroy_all(struct isoburn **objpt, int flag);
int isoburn_link(struct isoburn *o, struct isoburn *link, int flag);
int isoburn_count(struct isoburn *o, int flag);
int isoburn_by_idx(struct isoburn *o, int idx, struct isoburn **pt, int flag);
int isoburn_find_by_drive(struct isoburn **pt, struct burn_drive *d, int flag);
/* Non API inner interfaces */
/* Submit a libisofs error to the libburn messenger. An application message
reader shall recognize the error code range and attribute it to the
libisofs message channel to which one cannot submit via API.
@param iso_error_code return value <= 0 from a libisofs API call.
@param default_msg_text is to be put out if iso_error_code leads to no
error message
@param os_errno operating system errno, submit 0 if none is known
@param min_severity minimum severity, might be be increased if libisofs
error severity surpasses min_severity.
@param flag Bitfield, submit 0 for now
*/
int isoburn_report_iso_error(int iso_error_code, char default_msg_text[],
int os_errno, char min_severity[], int flag);
/* Calls from burn_wrap.c into isofs_wrap.c */
int isoburn_start_emulation(struct isoburn *o, int flag);
int isoburn_invalidate_iso(struct isoburn *o, int flag);
/* Calls from isofs_wrap.c into burn_wrap.c */
/** Get an eventual isoburn object which is wrapped around the drive.
@param pt Eventually returns a pointer to the found object.
It is allowed to become NULL if return value is -1 or 0.
In this case, the drive is a genuine libburn drive
with no emulation activated by isoburn.
@param drive The drive to be searched for
@param flag unused yet
@return -1 unsuitable medium, 0 generic medium, 1 emulated medium.
*/
int isoburn_find_emulator(struct isoburn **pt,
struct burn_drive *drive, int flag);
/* Deliver an event message. Either via a non-NULL o->msgs_submit() method
or via burn_msgs_submit() of libburn.
*/
int isoburn_msgs_submit(struct isoburn *o, int error_code, char msg_text[],
int os_errno, char severity[], int flag);
/** Set the start address for an emulated add-on session. The value will
be rounded up to the alignment necessary for the medium. The aligned
value will be divided by 2048 and then put into o->nwa .
@param o The isoburn object to be programmed.
@param value The start address in bytes
@param flag unused yet
@return <=0 is failure , >0 success
*/
int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag);
/** Obtains the image address offset to be used with image generation.
This is either the (emulated) drive nwa or a value set by
isoburn_prepare_blind_grow().
In any case this is the address to tell to iso_write_opts_set_ms_block().
@param o The isoburn object to be inquired
@param opts If not NULL: write parameters to be set on drive before query
@param msc2 The value to be used with iso_write_opts_set_ms_block()
@param flag unused yet
@return <=0 is failure , >0 success
*/
int isoburn_get_msc2(struct isoburn *o,
struct burn_write_opts *opts, int *msc2, int flag);
/** Get a data source suitable for read from a drive using burn_read_data()
function.
@param d drive to read from. Must be grabbed.
@param displacement will be added or subtracted to any block address
@param displacement_sign +1 = add , -1= subtract , else keep unaltered
@return the data source, NULL on error. Must be freed with libisofs
iso_data_source_unref() function. Note: this doesn't release
the drive.
*/
IsoDataSource *
isoburn_data_source_new(struct burn_drive *d,
uint32_t displacement, int displacement_sign,
int cache_tiles, int tile_blocks);
/** Default settings for above cache_tiles, tile_blocks in newly created
struct isoburn_read_opts.
*/
#define Libisoburn_default_cache_tileS 32
#define Libisoburn_default_tile_blockS 32
/** Maximum size of the cache in 2 kB blocks (1 GB)
*/
#define Libisoburn_cache_max_sizE (1024 * 512)
/** Disable read capabilities of a data source which was originally created
by isoburn_data_source_new(). After this any attempt to read will yield
a FATAL programming error event.
This is usually done to allow libburn to release the drive while libisofs
still holds a reference to the data source object. libisofs is not supposed
to use this object for reading any more, nevertheless. The disabled state
of the data source is a safety fence around this daring situation.
@param src The data source to be disabled
@param flag unused yet
@return <=0 is failure , >0 success
*/
int isoburn_data_source_shutdown(IsoDataSource *src, int flag);
/** Check whether the size of target_iso_head matches the given partition
offset. Eventually adjust size.
*/
int isoburn_adjust_target_iso_head(struct isoburn *o,
uint32_t offst, int flag);
/** Initialize the root directory attributes of a freshly created image.
*/
int isoburn_root_defaults(IsoImage *image, int flag);
/**
* Options for image reading.
(Comments here may be outdated. API getter/setter function descriptions
may override the descriptions here. Any difference is supposed to be a
minor correction only.)
*/
struct isoburn_read_opts {
int cache_tiles; /* number of cache tiles */
int cache_tile_blocks;
unsigned int norock:1; /*< Do not read Rock Ridge extensions */
unsigned int nojoliet:1; /*< Do not read Joliet extensions */
unsigned int noiso1999:1; /*< Do not read ISO 9660:1999 enhanced tree */
unsigned int do_ecma119_map:1; /* call iso_read_opts_set_ecma119_map() */
unsigned int map_mode:2; /* argument for do_ecma119_map */
/* ts A90121 */
unsigned int noaaip:1; /* Do not read AAIP for ACL and EA */
unsigned int noacl:1; /* Do not read ACL from external file objects */
unsigned int noea:1; /* Do not read XFS-style EA from externals */
/* ts A90508 */
unsigned int noino:1; /* Discard eventual PX inode numbers */
/* ts A90810 */
unsigned int nomd5:2; /* Do not read eventual MD5 array */
unsigned int preferjoliet:1;
/*< When both Joliet and RR extensions are present, the RR
* tree is used. If you prefer using Joliet, set this to 1. */
uid_t uid; /**< Default uid when no RR */
gid_t gid; /**< Default uid when no RR */
mode_t mode; /**< Default mode when no RR (only permissions) */
mode_t dirmode; /**< Default mode for directories
when no RR (only permissions) */
/**
* Input charset for RR file names. NULL to use default locale charset.
*/
char *input_charset;
/**
* Enable or disable methods to automatically choose an input charset.
* This eventually overrides input_charset.
*
* bit0= set the input character set automatically from
* attribute "isofs.cs" of root directory
*/
int auto_input_charset;
/**
* What to do in case of name longer than truncate_length:
* 0= throw FAILURE
* 1= truncate to truncate_length with MD5 of whole name at end
*/
int truncate_mode;
int truncate_length;
/* modified by the function isoburn_read_image */
unsigned int hasRR:1; /*< It will be set to 1 if RR extensions are present,
to 0 if not. */
unsigned int hasJoliet:1; /*< It will be set to 1 if Joliet extensions are
present, to 0 if not. */
/**
* It will be set to 1 if the image is an ISO 9660:1999, i.e. it has
* a version 2 Enhanced Volume Descriptor.
*/
unsigned int hasIso1999:1;
/** It will be set to 1 if El-Torito boot record is present, to 0 if not.*/
unsigned int hasElTorito:1;
uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
* the image, as reported in the PVM. */
unsigned int pretend_blank:1; /* always create empty image */
uint32_t displacement;
int displacement_sign;
};
/**
* Options for image generation by libisofs and image transport to libburn.
(Comments here may be outdated. API getter/setter function descriptions
may override the descriptions here. Any difference is supposed to be a
minor correction only.)
*/
struct isoburn_imgen_opts {
/* Options for image generation */
int will_cancel :1;
int level; /**< ISO level to write at. */
/** Which extensions to support. */
unsigned int rockridge :1;
unsigned int joliet :1;
unsigned int iso1999 :1;
unsigned int hfsplus :1;
unsigned int fat :1;
/* Whether to mark suitable IsoNode as hardlinks in RRIP PX */
unsigned int hardlinks :1;
/* Write eventual AAIP info containing ACL and EA */
unsigned int aaip :1;
/* Produce and write a MD5 checksum of the whole session stream. */
unsigned int session_md5 :1;
/* Produce and write MD5 checksums for each single IsoFile.
See parameter "files" of iso_write_opts_set_record_md5().
*/
unsigned int file_md5 :2;
/* On overwriteable media or random access files do not write the first
session to LBA 32, but rather to LBA 0 directly.
*/
unsigned int no_emul_toc :1;
/* For empty files, symbolic links, and devices use the old ECMA-119 block
addresses in the range [0,31] rather than the address of the dedicated
empty block.
*/
unsigned int old_empty :1;
/* relaxed constraints */
/*
* Relaxed constraints. Setting any of these to 1 break the specifications,
* but it is supposed to work on most moderns systems. Use with caution.
*/
/*
* Extra Caution: This option breaks any assumptions about names that
* are supported by ECMA-119 specifications.
* Omit any translation which would make a file name compliant to the
* ECMA-119 rules. This includes and exceeds omit_version_numbers,
* max_37_char_filenames, no_force_dots bit0, allow_lowercase.
*/
unsigned int untranslated_name_len;
/*
* Convert directory names for ECMA-119 similar to other file names, but do
* not force a dot or add a version number.
* This violates ECMA-119 by allowing one "." and especially ISO level 1
* by allowing DOS style 8.3 names rather than only 8 characters.
* (mkisofs and its clones seem to do this violation.)
*/
unsigned int allow_dir_id_ext :1;
/**
* Omit the version number (";1") at the end of the ISO-9660 identifiers.
* Version numbers are usually not used.
* bit0= omit version number with ECMA-119 and Joliet
* bit1= omit version number with Joliet alone
*/
unsigned int omit_version_numbers :2;
/**
* Allow ISO-9660 directory hierarchy to be deeper than 8 levels.
*/
unsigned int allow_deep_paths :1;
/**
* If not allow_deep_paths is in effect, then it may become
* necessary to relocate directories so that no ECMA-119 file path
* has more than 8 components. These directories are grafted into either
* the root directory of the ISO image or into a dedicated relocation
* directory. For details see libisofs.h, iso_write_opts_set_rr_reloc().
*/
char *rr_reloc_dir; /* IsoNode name in root directory. NULL or
empty text means root itself. */
int rr_reloc_flags; /* bit0= mark auto-created rr_reloc_dir by RE
bit1= not settable via API (used internally)
*/
/**
* Allow path in the ISO-9660 tree to have more than 255 characters.
*/
unsigned int allow_longer_paths :1;
/**
* Allow a single file or directory hierarchy to have up to 37 characters.
* This is larger than the 31 characters allowed by ISO level 2, and the
* extra space is taken from the version number, so this also forces
* omit_version_numbers.
*/
unsigned int max_37_char_filenames :1;
/**
* ISO-9660 forces filenames to have a ".", that separates file name from
* extension. libisofs adds it if original filename doesn't has one. Set
* this to 1 to prevent this behavior
* bit0= no forced dot with ECMA-119
* bit1= no forced dot with Joliet
*/
unsigned int no_force_dots :2;
/**
* Allow lowercase characters in ISO-9660 filenames. By default, only
* uppercase characters, numbers and a few other characters are allowed.
*/
unsigned int allow_lowercase :1;
/**
* Allow all ASCII characters to be appear on an ISO-9660 filename. Note
* that "/" and "\0" characters are never allowed, even in RR names.
*/
unsigned int allow_full_ascii :1;
/**
* Like allow_full_ascii, but only allowing 7-bit characters.
* Lowercase letters get mapped to uppercase if not allow_lowercase is set.
* Gets overridden if allow_full_ascii is enabled.
*/
unsigned int allow_7bit_ascii :1;
/**
* Allow paths in the Joliet tree to have more than 240 characters.
*/
unsigned int joliet_longer_paths :1;
/**
* Allow leaf names in the Joliet tree to have up to 103 characters
* rather than 64.
*/
unsigned int joliet_long_names :1;
/**
* Use UTF-16BE rather than its subset UCS-2
*/
unsigned int joliet_utf16 :1;
/**
* Store timestamps as GMT rather than in local time.
*/
unsigned int always_gmt :1;
/**
* Write Rock Ridge info as of specification RRIP-1.10 rather than
* RRIP-1.12: signature "RRIP_1991A" rather than "IEEE_1282",
* field PX without file serial number
*/
unsigned int rrip_version_1_10 :1;
/**
* Store as ECMA-119 Directory Record timestamp the mtime
* of the source rather than the image creation time.
* The same can be ordered for Joliet and ISO 9660:1999
*/
unsigned int dir_rec_mtime :1;
unsigned int joliet_rec_mtime :1;
unsigned int iso1999_rec_mtime :1;
/**
* Write AAIP as extension according to SUSP 1.10 rather than SUSP 1.12.
* I.e. without announcing it by an ER field and thus without the need
* to precede the RRIP fields by an ES and to precede the AA field by ES.
*/
unsigned int aaip_susp_1_10 :1;
unsigned int sort_files:1;
/**< If files should be sorted based on their weight. */
/**
* The following options set the default values for files and directory
* permissions, gid and uid. All these take one of three values: 0, 1 or 2.
* If 0, the corresponding attribute will be kept as set in the IsoNode.
* Unless you have changed it, it corresponds to the value on disc, so it
* is suitable for backup purposes. If set to 1, the corresponding attrib.
* will be changed by a default suitable value. Finally, if you set it to
* 2, the attrib. will be changed with the value specified in the options
* below. Note that for mode attributes, only the permissions are set, the
* file type remains unchanged.
*/
unsigned int replace_dir_mode :2;
unsigned int replace_file_mode :2;
unsigned int replace_uid :2;
unsigned int replace_gid :2;
mode_t dir_mode; /** Mode to use on dirs when replace_dir_mode == 2. */
mode_t file_mode; /** Mode to use on files when replace_file_mode == 2. */
uid_t uid; /** uid to use when replace_uid == 2. */
gid_t gid; /** gid to use when replace_gid == 2. */
char *output_charset; /**< NULL to use default charset */
/* Options for image transport */
/** The number of bytes to be used for the fifo which decouples libisofs
and libburn for better throughput and for reducing the risk of
interrupting signals hitting the libburn thread which operates the
MMC drive.
The size will be rounded up to the next full 2048.
Minimum is 64kiB, maximum is 1 GiB (but that is too much anyway).
*/
int fifo_size;
/** Output value: Block address of session start as evaluated from medium
and other options by libisoburn and libburn.
If <0 : Invalid
If >=0: Valid block number. Block size is always 2 KiB.
*/
int effective_lba;
/** Output value: Block address of data section start as predicted by
libisofs.
If < 16: Invalid
If >=16: Valid block number. Block size is always 2 KiB.
*/
int data_start_lba;
/**
* If not empty: Parameters "name" and "timestamp" for a scdbackup stream
* checksum tag. See scdbackup/README appendix VERIFY.
* It makes sense only for single session images which start at LBA 0.
* Such a tag may be part of a libisofs checksum tag block after the
* session tag line. It then covers the whole session up to its own start
* position.
* If scdbackup_tag_written is not NULL then it is a pointer to an
* application provided array with at least 512 characters. The effectively
* written scdbackup tag will be copied to this memory location.
*/
char scdbackup_tag_name[81];
char scdbackup_tag_time[19];
char *scdbackup_tag_written;
/* Content of an embedded boot image. Valid if not NULL.
* In that case it must point to a memory buffer at least 32 kB.
*/
char *system_area_data;
/*
* bit0= make bytes 446 - 512 of the system area a partition
* table which reserves partition 1 from byte 63*512 to the
* end of the ISO image. Assumed are 63 secs/hed, 255 head/cyl.
* (GRUB protective msdos label.)
* This works with and without system_area_data.
*/
int system_area_options;
/* User settable PVD time stamps */
time_t vol_creation_time;
time_t vol_modification_time;
time_t vol_expiration_time;
time_t vol_effective_time;
/* To eventually override vol_modification_time by unconverted string
and timezone 0 */
char vol_uuid[17];
/* The number of unclaimed 2K blocks before start of partition 1 as of
the MBR in system area. If not 0 this will cause double volume
descriptor sets and double tree.
*/
uint32_t partition_offset;
/* Partition table parameter: 1 to 63, 0= disabled/default */
int partition_secs_per_head;
/* 1 to 255, 0= disabled/default */
int partition_heads_per_cyl;
/* Parameters and state of Jigdo Template Export environment.
*/
void *libjte_handle;
/* A trailing padding of zero bytes which belongs to the image
*/
uint32_t tail_blocks;
/* Disk file paths of content of PreP partition and EFI system partition */
char *prep_partition;
int prep_part_flag;
char *efi_boot_partition;
int efi_boot_part_flag;
/* Eventual disk file paths of prepared images which shall be appended
after the ISO image and described by partiton table entries in a MBR.
*/
char *appended_partitions[Libisoburn_max_appended_partitionS];
uint8_t appended_part_types[Libisoburn_max_appended_partitionS];
int appended_part_flags[Libisoburn_max_appended_partitionS];
/* If 1: With appended partitions: create protective MBR and mark by GPT
*/
int appended_as_gpt;
/* If 1: With appended partitions: mark by APM
*/
int appended_as_apm;
/* If 1: Apply isohybrid gestures to non-isohybrid situations
*/
int part_like_isohybrid;
/* See libisoburn.h isoburn_igopt_set_gpt_guid()
*/
uint8_t gpt_guid[16];
int gpt_guid_mode;
/* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
*/
char ascii_disc_label[Libisoburn_disc_label_sizE];
/* HFS+ image serial number.
* 00...00 means that it shall be generated by libisofs.
*/
uint8_t hfsp_serial_number[8];
/* Allocation block size of HFS+ : 0= auto , 512, or 2048
*/
int hfsp_block_size;
/* Block size of and in APM : 0= auto , 512, or 2048
*/
int apm_block_size;
/* Write mode for optical media:
* 0 = auto
* 1 = TAO, Incremental, no RESERVE TRACK
* -1 = SAO, DAO, RESERVE TRACK
*/
int do_tao;
/* Whether to fsync() stdio_drives after isoburn_activate_session() */
int do_fsync;
};
/* Alignment for session starts on overwriteable media.
(Increased from 16 to 32 blocks for aligning to BD-RE clusters.)
*/
#define Libisoburn_nwa_alignemenT 32
/* Alignment for outer session scanning with -ROM drives.
(E.g. my DVD-ROM drive shows any DVD type as 0x10 "DVD-ROM" with
more or less false capacity and TOC.)
*/
#define Libisoburn_toc_scan_alignemenT 16
/* Maximum gap to be bridged during a outer TOC scan. Gaps appear between the
end of a session and the start of the next session.
The longest gap found so far was about 38100 after the first session of a
DVD-R.
*/
#define Libisoburn_toc_scan_max_gaP 65536
/* Creating a chain of image headers which form a TOC:
The header of the first session is written after the LBA 0 header.
So it persists and can give the end of its session. By help of
Libisoburn_nwa_alignemenT it should be possible to predict the start
of the next session header.
The LBA 0 header is written by isoburn_activate_session() already
with the first session. So the medium is mountable.
A problem arises with DVD-RW in Intermediate State. They cannot be
written by random access before they were written sequentially.
In this case, no copy of the session 1 header is maintained and no TOC
will be possible. Thus writing begins sequentially at LBA 0.
IMPORTANT: This macro gives the minimal size of an image header.
It has to be enlarged by the eventual partition offset.
*/
#define Libisoburn_overwriteable_starT \
((off_t) (Libisoburn_target_head_sizE/2048))
/* Wrappers for emulation of TOC on overwriteable media */
struct isoburn_toc_track {
/* Either track or toc_entry are supposed to be NULL */
struct burn_track *track;
struct isoburn_toc_entry *toc_entry;
};
struct isoburn_toc_session {
/* Either session or tracks and toc_entry are supposed to be NULL */
struct burn_session *session;
struct isoburn_toc_track **track_pointers;
int track_count;
struct isoburn_toc_entry *toc_entry;
};
struct isoburn_toc_disc {
/* Either disc or sessions and toc are supposed to be NULL */
struct burn_disc *disc;
struct isoburn_toc_session *sessions; /* storage array */
struct isoburn_toc_session **session_pointers; /* storage array */
struct isoburn_toc_track *tracks; /* storage array */
struct isoburn_toc_track **track_pointers; /* storage array */
int session_count;
int incomplete_session_count;
int track_count;
struct isoburn_toc_entry *toc;
};
#endif /* Isoburn_includeD */

View File

@ -0,0 +1,718 @@
/*
cc -g -c isofs_wrap.c
*/
/*
libisofs related functions of libisoburn.
Copyright 2007 - 2011 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifndef Xorriso_standalonE
#include <libburn/libburn.h>
#include <libisofs/libisofs.h>
#else /* ! Xorriso_standalonE */
#include "../libisofs/libisofs.h"
#include "../libburn/libburn.h"
#endif /* Xorriso_standalonE */
#include "libisoburn.h"
#include "isoburn.h"
#define BP(a,b) [(b) - (a) + 1]
struct ecma119_pri_vol_desc
{
uint8_t vol_desc_type BP(1, 1);
uint8_t std_identifier BP(2, 6);
uint8_t vol_desc_version BP(7, 7);
uint8_t unused1 BP(8, 8);
uint8_t system_id BP(9, 40);
uint8_t volume_id BP(41, 72);
uint8_t unused2 BP(73, 80);
uint8_t vol_space_size BP(81, 88);
uint8_t unused3 BP(89, 120);
uint8_t vol_set_size BP(121, 124);
uint8_t vol_seq_number BP(125, 128);
uint8_t block_size BP(129, 132);
uint8_t path_table_size BP(133, 140);
uint8_t l_path_table_pos BP(141, 144);
uint8_t opt_l_path_table_pos BP(145, 148);
uint8_t m_path_table_pos BP(149, 152);
uint8_t opt_m_path_table_pos BP(153, 156);
uint8_t root_dir_record BP(157, 190);
uint8_t vol_set_id BP(191, 318);
uint8_t publisher_id BP(319, 446);
uint8_t data_prep_id BP(447, 574);
uint8_t application_id BP(575, 702);
uint8_t copyright_file_id BP(703, 739);
uint8_t abstract_file_id BP(740, 776);
uint8_t bibliographic_file_id BP(777, 813);
uint8_t vol_creation_time BP(814, 830);
uint8_t vol_modification_time BP(831, 847);
uint8_t vol_expiration_time BP(848, 864);
uint8_t vol_effective_time BP(865, 881);
uint8_t file_structure_version BP(882, 882);
uint8_t reserved1 BP(883, 883);
uint8_t app_use BP(884, 1395);
uint8_t reserved2 BP(1396, 2048);
};
static
uint32_t iso_read_lsb(const uint8_t *buf, int bytes)
{
int i;
uint32_t ret = 0;
for (i=0; i<bytes; i++) {
ret += ((uint32_t) buf[i]) << (i*8);
}
return ret;
}
/* API function. See libisoburn.h
*/
IsoImage *isoburn_get_attached_image(struct burn_drive *d)
{
int ret;
struct isoburn *o= NULL;
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0)
return NULL;
if (o == NULL) {
return NULL;
}
iso_image_ref(o->image);
return o->image;
}
/* API */
int isoburn_get_attached_start_lba(struct burn_drive *d)
{
int ret;
struct isoburn *o= NULL;
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0 || o == NULL)
return -1;
if(o->image == NULL)
return -1;
return o->image_start_lba;
}
static void isoburn_idle_free_function(void *ignored)
{
return;
}
int isoburn_root_defaults(IsoImage *image, int flag)
{
IsoNode *root_node;
mode_t root_mode= 0755;
root_node= (IsoNode *) iso_image_get_root(image);
iso_node_set_permissions(root_node, root_mode);
return(1);
}
/* API function. See libisoburn.h
*/
int isoburn_read_image(struct burn_drive *d,
struct isoburn_read_opts *read_opts,
IsoImage **image)
{
int ret, int_num, dummy;
IsoReadOpts *ropts= NULL;
IsoReadImageFeatures *features= NULL;
uint32_t ms_block;
char *msg= NULL;
enum burn_disc_status status= BURN_DISC_BLANK;
IsoDataSource *ds= NULL;
struct isoburn *o= NULL;
IsoImage *new_image= NULL;
msg= calloc(1, 160);
if(d != NULL) {
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0 || o == NULL)
{ret= 0; goto ex;}
status = isoburn_disc_get_status(d);
o->image_start_lba= -1;
}
if(read_opts==NULL) {
isoburn_msgs_submit(o, 0x00060000,
"Program error: isoburn_read_image: read_opts==NULL",
0, "FATAL", 0);
{ret= -1; goto ex;}
}
if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) {
create_blank_image:;
/*
* Blank disc, we create a new image without files.
*/
if (d == NULL) {
/* New empty image without relation to a drive */
if (image==NULL) {
isoburn_msgs_submit(o, 0x00060000,
"Program error: isoburn_read_image: image==NULL",
0, "FATAL", 0);
{ret= -1; goto ex;}
}
/* create a new image */
ret = iso_image_new("ISOIMAGE", image);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
goto ex;
}
iso_image_set_ignore_aclea(*image,
(!!(read_opts->noacl)) | ((!!read_opts->noea) << 1) );
new_image= *image;
} else {
/* Blank new image for the drive */
iso_image_unref(o->image);
ret = iso_image_new("ISOIMAGE", &o->image);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create image", 0, "FATAL", 0);
goto ex;
}
if (image != NULL) {
*image = o->image;
iso_image_ref(*image); /*protects object from premature free*/
}
iso_image_set_ignore_aclea(o->image,
(!!(read_opts->noacl)) | ((!!read_opts->noea) << 1) );
ret= isoburn_root_defaults(o->image, 0);
if(ret <= 0)
goto ex;
new_image= o->image;
}
ret= iso_image_set_truncate_mode(new_image, read_opts->truncate_mode,
read_opts->truncate_length);
if(ret < 0)
goto ex;
{ret= 1; goto ex;}
}
if (status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL) {
isoburn_msgs_submit(o, 0x00060000,
"Program error: isoburn_read_image: incorrect disc status",
0, "FATAL", 0);
{ret= -4; goto ex;}
}
ret = isoburn_disc_get_msc1(d, &int_num);
if (ret <= 0)
{ret= -2; goto ex;}
ms_block= int_num;
if (o != NULL)
o->image_start_lba= ms_block;
ret = isoburn_read_iso_head(d, int_num, &dummy, NULL, 0);
if (ret <= 0) {
sprintf(msg, "No ISO 9660 image at LBA %d. Creating blank image.", int_num);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
goto create_blank_image;
}
if(read_opts->displacement != 0 && abs(read_opts->displacement_sign) == 1) {
/* Apply reverse displacement to session start */
if(read_opts->displacement_sign == -1) {
if(ms_block+ read_opts->displacement < ms_block) {
displacement_rollover:;
sprintf(msg, "Displacement offset leads outside 32 bit range.");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ms_block+= read_opts->displacement;
} else {
if(ms_block < read_opts->displacement)
goto displacement_rollover;
ms_block-= read_opts->displacement;
}
}
/* create the data source */
ret = iso_read_opts_new(&ropts, 0);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
goto ex;
}
/* Important: do not return until iso_read_opts_free() */
iso_read_opts_set_start_block(ropts, ms_block);
iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
iso_read_opts_set_no_aaip(ropts, read_opts->noaaip);
if(read_opts->nomd5 == 2)
int_num= 2;
else if(read_opts->nomd5 == 1)
int_num= 1;
else
int_num= 0;
iso_read_opts_set_no_md5(ropts, int_num);
if(read_opts->do_ecma119_map)
iso_read_opts_set_ecma119_map(ropts, read_opts->map_mode);
iso_read_opts_set_new_inos(ropts, read_opts->noino);
iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet);
iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999);
iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet);
iso_read_opts_set_default_permissions(ropts,
read_opts->mode, read_opts->dirmode);
iso_read_opts_set_default_uid(ropts, read_opts->uid);
iso_read_opts_set_default_gid(ropts, read_opts->gid);
iso_read_opts_set_input_charset(ropts, read_opts->input_charset);
iso_read_opts_auto_input_charset(ropts, read_opts->auto_input_charset);
iso_read_opts_load_system_area(ropts, 1);
iso_read_opts_keep_import_src(ropts, 1);
ret= iso_image_set_truncate_mode(o->image, read_opts->truncate_mode,
read_opts->truncate_length);
if(ret < 0)
goto ex;
ds = isoburn_data_source_new(d, read_opts->displacement,
read_opts->displacement_sign,
read_opts->cache_tiles, read_opts->cache_tile_blocks);
if (ds == NULL) {
isoburn_report_iso_error(ret, "Cannot create IsoDataSource object", 0,
"FATAL", 0);
ret= -1; goto ex;
}
if(o->iso_data_source!=NULL)
iso_data_source_unref(o->iso_data_source);
o->iso_data_source= ds;
iso_image_attach_data(o->image, o->read_pacifier_handle,
isoburn_idle_free_function);
if(o->read_pacifier_handle==NULL)
iso_tree_set_report_callback(o->image, NULL);
else
iso_tree_set_report_callback(o->image, o->read_pacifier);
ret = iso_image_import(o->image, ds, ropts, &features);
iso_tree_set_report_callback(o->image, NULL);
iso_read_opts_free(ropts);
ropts= NULL;
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot import image", 0, "FAILURE", 0);
goto ex;
}
/* Important: do not return until free(features) */
if (image!=NULL) {
*image = o->image;
iso_image_ref(*image); /*protects object from premature free*/
}
read_opts->hasRR = iso_read_image_features_has_rockridge(features);
read_opts->hasJoliet = iso_read_image_features_has_joliet(features);
read_opts->hasIso1999 = iso_read_image_features_has_iso1999(features);
read_opts->hasElTorito = iso_read_image_features_has_eltorito(features);
read_opts->size = iso_read_image_features_get_size(features);
ret= 1;
ex:;
if(msg != NULL)
free(msg);
if(ropts != NULL)
iso_read_opts_free(ropts);
if(features != NULL)
iso_read_image_features_destroy(features);
return(ret);
}
/* API function. See libisoburn.h
*/
int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
{
int ret;
struct isoburn *o;
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0 || o == NULL)
return 0;
if (image == NULL) {
isoburn_msgs_submit(o, 0x00060000,
"Program error: isoburn_attach_image: image==NULL",
0, "FATAL", 0);
return -1;
}
if(o->image != NULL)
iso_image_unref(o->image);
o->image = image;
o->image_start_lba = -1;
return(1);
}
/* API */
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
{
int ret;
struct isoburn *o;
ret = isoburn_find_emulator(&o, d, 0);
if(ret < 0)
return ret;
if(o == NULL)
return 0;
if(o->image == NULL)
return 0;
o->image_start_lba = lba;
return 1;
}
/* API function. See libisoburn.h
*/
int isoburn_activate_session(struct burn_drive *drive)
{
int ret, do_sync = 1;
struct isoburn *o;
ret = isoburn_find_emulator(&o, drive, 0);
if (ret < 0)
return -1;
if (o->emulation_mode != 1)
return 1; /* don't need to activate session */
if (o->fabricated_msc2 >= 0)
return 1; /* blind growing: do not alter anything outside the session */
if (!(o->fabricated_disc_status == BURN_DISC_APPENDABLE ||
(o->fabricated_disc_status == BURN_DISC_BLANK &&
o->zero_nwa > 0)))
return 1;
ret = burn_drive_get_drive_role(drive);
if (ret != 1)
do_sync = !! o->do_fsync;
ret = burn_random_access_write(drive, (off_t) 0, (char*)o->target_iso_head,
o->target_iso_head_size, do_sync);
return ret;
}
/** API @since 0.6.2
*/
int isoburn_get_img_partition_offset(struct burn_drive *drive,
uint32_t *block_offset_2k)
{
int ret;
struct isoburn *o;
ret = isoburn_find_emulator(&o, drive, 0);
if(ret < 0 || o == NULL)
return -1;
*block_offset_2k= o->loaded_partition_offset;
if(o->loaded_partition_offset == 0)
return(0);
if(o->target_iso_head_size == (off_t) Libisoburn_target_head_sizE
+ (off_t) 2048 * (off_t) o->loaded_partition_offset)
return(1);
return(2);
}
/* Check for MBR signature and a first partition that starts at a 2k block
and ends where the image ends.
If not too large or too small, accept its start as partition offset.
*/
static int isoburn_inspect_partition(struct isoburn *o, uint32_t img_size,
int flag)
{
uint8_t *mbr, *part, *buf= NULL;
uint32_t offst, numsec;
struct ecma119_pri_vol_desc *pvm;
off_t data_count;
int ret;
char *msg= NULL;
static int max_offst= 512 - 32;
buf= (uint8_t *) calloc(1, 2048);
msg= calloc(1, 160);
if(buf == NULL || msg == NULL)
{ret= -1; goto ex;}
mbr= o->target_iso_head;
part= mbr + 446;
if(mbr[510] != 0x55 || mbr[511] != 0xAA)
{ret= 2; goto ex;} /* not an MBR */
/* Does the first partition entry look credible ? */
if(part[0] != 0x80 && part[0] != 0x00)
{ret= 2; goto ex;} /* Invalid partition status */
if(part[1] == 0 && part[2] == 0 && part[3] == 0)
{ret= 2; goto ex;} /* Zero C/H/S start address */
/* Does it match the normal ISO image ? */
offst= iso_read_lsb(part + 8, 4);
numsec= iso_read_lsb(part + 12, 4);
if(offst < 64)
{ret= 2; goto ex;} /* Zero or unusably small partition start */
if((offst % 4) || (numsec % 4))
{ret= 2; goto ex;} /* Not aligned to 2k */
if(numsec < 72)
{ret= 2; goto ex;} /* No room for volume descriptors */
offst/= 4;
numsec/= 4;
if(offst + numsec != img_size)
{ret= 2; goto ex;} /* Partition end does not match image end */
/* Is there a PVD at the partition start ? */
ret = burn_read_data(o->drive, (off_t) (offst + 16) * (off_t) 2048,
(char*) buf, 2048, &data_count, 32);
if(ret <= 0)
{ret= 2; goto ex;}
pvm = (struct ecma119_pri_vol_desc *) buf;
if (strncmp((char*) pvm->std_identifier, "CD001", 5) != 0)
{ret= 2; goto ex;} /* not a PVD */
if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1
|| pvm->file_structure_version[0] != 1 )
{ret= 2; goto ex;} /* failed sanity check */
if(iso_read_lsb(pvm->vol_space_size, 4) + offst != img_size)
{ret= 2; goto ex;} /* Image ends do not match */
/* Now it is credible. Not yet clear is whether it is acceptable. */
o->loaded_partition_offset= offst;
/* If the partition start is too large: Report but do not accept. */
if(offst > (uint32_t) max_offst) {/* Not more than 1 MB of .target_iso_head */
sprintf(msg,
"Detected partition offset of %.f blocks. Maximum for load buffer is %d",
(double) offst, max_offst);
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "WARNING", 0);
{ret= 3; goto ex;}
}
/* Accept partition start and adjust buffer size */
ret= isoburn_adjust_target_iso_head(o, offst, 0);
if(ret <= 0)
goto ex;
ret= 1;
ex:;
if(buf != NULL)
free(buf);
if(msg != NULL)
free(msg);
return(ret);
}
/** Initialize the emulation of multi-session on random access media.
The need for emulation is confirmed already.
@param o A freshly created isoburn object. isoburn_create_data_source() was
already called, nevertheless.
@param flag bit0= read-only
@return <=0 error , 1 = success
*/
int isoburn_start_emulation(struct isoburn *o, int flag)
{
int ret, i, capacity = -1, role, dummy;
off_t data_count, to_read;
struct burn_drive *drive;
struct ecma119_pri_vol_desc *pvm;
enum burn_disc_status s;
char *path= NULL, *msg= NULL;
path= calloc(1, BURN_DRIVE_ADR_LEN);
msg= calloc(1, 2 * BURN_DRIVE_ADR_LEN);
if(path == NULL || msg == NULL)
{ret= -1; goto ex;}
if(o==NULL) {
isoburn_msgs_submit(NULL, 0x00060000,
"Program error: isoburn_start_emulation: o==NULL",
0, "FATAL", 0);
{ret= -1; goto ex;}
}
drive= o->drive;
if(flag & 1)
o->fabricated_disc_status= BURN_DISC_FULL;
/* We can assume 0 as start block for image.
The data there point to the most recent session.
*/
role = burn_drive_get_drive_role(drive);
ret = burn_get_read_capacity(drive, &capacity, 0);
if (ret <= 0)
capacity = -1;
if (role == 5) { /* random access write-only medium */
s = burn_disc_get_status(drive);
o->fabricated_disc_status= s;
burn_disc_track_lba_nwa(drive, NULL, 0, &dummy, &(o->nwa));
if(o->nwa < o->zero_nwa)
o->zero_nwa= 0;
{ret= 1; goto ex;}
} else if (capacity > 0 || role == 2 || role == 4) {
/* Might be a block device on a system where libburn cannot determine its
size. Try to read anyway. */
to_read = o->target_iso_head_size;
memset(o->target_iso_head, 0, to_read);
if(capacity > 0 && (off_t) capacity * (off_t) 2048 < to_read)
to_read = (off_t) capacity * (off_t) 2048;
ret = burn_read_data(drive, (off_t) 0, (char*)o->target_iso_head,
to_read, &data_count, 32 | 8);
if (ret <= 0) {
/* an error means a disc with no ISO image */
o->media_read_error= 1;
if (ret == -2) {
path[0]= 0;
burn_drive_d_get_adr(drive, path);
sprintf(msg, "Pseudo drive '%s' does not allow reading", path);
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "NOTE", 0);
o->fabricated_disc_status= BURN_DISC_BLANK;
} else if (capacity > 0)
o->fabricated_disc_status= BURN_DISC_FULL;
else if(!(flag & 1))
o->fabricated_disc_status= BURN_DISC_BLANK;
{ret= 1; goto ex;}
}
} else {
/* No read capacity means blank medium */
if(!(flag & 1))
o->fabricated_disc_status= BURN_DISC_BLANK;
{ret= 1; goto ex;}
}
/* check first 64K. If 0's, the disc is treated as a blank disc, and thus
overwritten without extra check. */
i = Libisoburn_target_head_sizE;
while (i && !o->target_iso_head[i-1])
--i;
if (!i) {
if(!(flag & 1))
o->fabricated_disc_status= BURN_DISC_BLANK;
{ret= 1; goto ex;}
}
pvm = (struct ecma119_pri_vol_desc *)(o->target_iso_head + 16 * 2048);
if (strncmp((char*)pvm->std_identifier, "CD001", 5) == 0) {
off_t size;
/* sanity check */
if (pvm->vol_desc_type[0] != 1 || pvm->vol_desc_version[0] != 1
|| pvm->file_structure_version[0] != 1 ) {
/* TODO for now I treat this as a full disc */
o->fabricated_disc_status= BURN_DISC_FULL;
{ret= 1; goto ex;}
}
/* ok, PVM found, set size */
size = (off_t) iso_read_lsb(pvm->vol_space_size, 4);
ret= isoburn_inspect_partition(o, (uint32_t) size, 0);
if (ret <= 0)
goto ex;
size *= (off_t) 2048; /* block size in bytes */
isoburn_set_start_byte(o, size, 0);
if(!(flag & 1))
o->fabricated_disc_status= BURN_DISC_APPENDABLE;
} else if (strncmp((char*)pvm->std_identifier, "CDXX1", 5) == 0 ||
(strncmp((char*)pvm->std_identifier, "CDxx1", 5) == 0 &&
pvm->vol_desc_type[0] == 'x')) {
/* empty image */
isoburn_set_start_byte(o, o->zero_nwa * 2048, 0);
if(!(flag & 1))
o->fabricated_disc_status= BURN_DISC_BLANK;
} else {
/* treat any disc in an unknown format as full */
o->fabricated_disc_status= BURN_DISC_FULL;
}
ret= 1;
ex:;
if(path != NULL)
free(path);
if(msg != NULL)
free(msg);
return(ret);
}
/** Alters and writes the first 64 kB of a "medium" to invalidate
an ISO image. (It shall stay restorable by skilled humans, though).
The result shall especially keep libisoburn from accepting the medium
image as ISO filesystem.
@param o A fully activated isoburn object. isoburn_start_emulation()
was already called.
@return <=0 error , 1 = success
*/
int isoburn_invalidate_iso(struct isoburn *o, int flag)
{
int end_ed_found= 0, i;
char *head;
head= (char *) o->target_iso_head;
/*
* replace CD001 with CDXX1 in PVM.
* I think this is enought for invalidating an iso image
*/
strncpy(head + 16 * 2048 + 1, "CDXX1", 5);
/* Look for UDF volume recognition sequence and invalidate */
for(i= 17 * 2048; i < 32 * 2048; i+= 2048) {
if(end_ed_found) {
if(head[i] == 0 && strncmp(head + i + 1, "BEA01", 5) == 0)
strncpy(head + i + 1, "BEAX1", 5);
else if(head[i] == 0 && strncmp(head + i + 1, "NSR", 3) == 0)
strncpy(head + i + 1, "NSRX", 4);
else if(head[i] == 0 && strncmp(head + i + 1, "TEA", 3) == 0)
strncpy(head + i + 1, "TEAX", 4);
} else {
if(((unsigned char *) head)[i] == 0xff &&
strncmp(head + i + 1, "CD001", 5) == 0)
end_ed_found= 1;
}
}
return isoburn_activate_session(o->drive);
}
/* API @since 0.1.0 */
int isoburn_set_read_pacifier(struct burn_drive *drive,
int (*read_pacifier)(IsoImage*, IsoFileSource*),
void *read_handle)
{
int ret;
struct isoburn *o;
ret = isoburn_find_emulator(&o, drive, 0);
if(ret < 0 || o == NULL)
return -1;
o->read_pacifier_handle= read_handle;
o->read_pacifier= read_pacifier;
return(1);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,350 @@
LIBISOBURN1 {
global:
isoburn_activate_session;
isoburn_attach_image;
isoburn_attach_start_lba;
isoburn_conv_name_chars;
isoburn_cancel_prepared_write;
isoburn_disc_available_space;
isoburn_disc_erasable;
isoburn_disc_erase;
isoburn_disc_get_msc1;
isoburn_disc_get_status;
isoburn_disc_pretend_full_uncond;
isoburn_disc_track_lba_nwa;
isoburn_disc_write;
isoburn_drive_aquire;
isoburn_drive_grab;
isoburn_drive_release;
isoburn_drive_scan_and_grab;
isoburn_drive_set_msgs_submit;
isoburn_drive_wrote_well;
isoburn_finish;
isoburn_get_attached_image;
isoburn_get_attached_start_lba;
isoburn_get_fifo_status;
isoburn_get_min_start_byte;
isoburn_get_mount_params;
isoburn_igopt_attach_jte;
isoburn_igopt_destroy;
isoburn_igopt_detach_jte;
isoburn_igopt_get_appended_as_apm;
isoburn_igopt_get_appended_as_gpt;
isoburn_igopt_get_data_start;
isoburn_igopt_get_disc_label;
isoburn_igopt_get_effective_lba;
isoburn_igopt_get_efi_bootp;
isoburn_igopt_get_extensions;
isoburn_igopt_get_fifo_size;
isoburn_igopt_get_gpt_guid;
isoburn_igopt_get_hfsp_block_size;
isoburn_igopt_get_hfsp_serial_number;
isoburn_igopt_get_level;
isoburn_igopt_get_out_charset;
isoburn_igopt_get_over_mode;
isoburn_igopt_get_over_ugid;
isoburn_igopt_get_part_flags;
isoburn_igopt_get_part_like_isohybrid;
isoburn_igopt_get_partition_img;
isoburn_igopt_get_prep_partition;
isoburn_igopt_get_pvd_times;
isoburn_igopt_get_relaxed;
isoburn_igopt_get_rr_reloc;
isoburn_igopt_get_scdbackup_tag;
isoburn_igopt_get_sort_files;
isoburn_igopt_get_stdio_endsync;
isoburn_igopt_get_system_area;
isoburn_igopt_get_tail_blocks;
isoburn_igopt_get_untranslated_name_len;
isoburn_igopt_get_write_type;
isoburn_igopt_new;
isoburn_igopt_set_appended_as_apm;
isoburn_igopt_set_appended_as_gpt;
isoburn_igopt_set_disc_label;
isoburn_igopt_set_efi_bootp;
isoburn_igopt_set_extensions;
isoburn_igopt_set_fifo_size;
isoburn_igopt_set_gpt_guid;
isoburn_igopt_set_hfsp_block_size;
isoburn_igopt_set_hfsp_serial_number;
isoburn_igopt_set_level;
isoburn_igopt_set_out_charset;
isoburn_igopt_set_over_mode;
isoburn_igopt_set_over_ugid;
isoburn_igopt_set_part_flag;
isoburn_igopt_set_part_like_isohybrid;
isoburn_igopt_set_partition_img;
isoburn_igopt_set_prep_partition;
isoburn_igopt_set_pvd_times;
isoburn_igopt_set_relaxed;
isoburn_igopt_set_rr_reloc;
isoburn_igopt_set_scdbackup_tag;
isoburn_igopt_set_sort_files;
isoburn_igopt_set_stdio_endsync;
isoburn_igopt_set_system_area;
isoburn_igopt_set_tail_blocks;
isoburn_igopt_set_untranslated_name_len;
isoburn_igopt_set_write_type;
isoburn_initialize;
isoburn_is_compatible;
isoburn_libburn_req;
isoburn_libisofs_req;
isoburn_libjte_req;
isoburn_needs_emulation;
isoburn_prepare_blind_grow;
isoburn_prepare_disc;
isoburn_prepare_new_image;
isoburn_read_image;
isoburn_read_iso_head;
isoburn_ropt_destroy;
isoburn_ropt_get_auto_incharset;
isoburn_ropt_get_data_cache;
isoburn_ropt_get_default_dirperms;
isoburn_ropt_get_default_perms;
isoburn_ropt_get_displacement;
isoburn_ropt_get_extensions;
isoburn_ropt_get_input_charset;
isoburn_ropt_get_size_what;
isoburn_ropt_get_truncate_mode;
isoburn_ropt_new;
isoburn_ropt_set_auto_incharset;
isoburn_ropt_set_data_cache;
isoburn_ropt_set_default_dirperms;
isoburn_ropt_set_default_perms;
isoburn_ropt_set_displacement;
isoburn_ropt_set_extensions;
isoburn_ropt_set_input_charset;
isoburn_ropt_set_truncate_mode;
isoburn_set_msc1;
isoburn_set_msgs_submit;
isoburn_set_read_pacifier;
isoburn_set_truncate;
isoburn_sync_after_write;
isoburn_toc_disc_free;
isoburn_toc_disc_get_incmpl_sess;
isoburn_toc_disc_get_sectors;
isoburn_toc_disc_get_sessions;
isoburn_toc_drive_get_disc;
isoburn_toc_session_get_leadout_entry;
isoburn_toc_session_get_sectors;
isoburn_toc_session_get_tracks;
isoburn_toc_track_get_emul;
isoburn_toc_track_get_entry;
isoburn_version;
Xorriso__dispose_words;
Xorriso__get_patch_level_text;
Xorriso__is_compatible;
Xorriso__preset_signal_behavior;
Xorriso__severity_cmp;
Xorriso__severity_list;
Xorriso__version;
Xorriso_change_is_pending;
Xorriso_destroy;
Xorriso_dialog;
Xorriso_eval_problem_status;
Xorriso_execute_option;
Xorriso_fetch_outlists;
Xorriso_get_problem_status;
Xorriso_interpreter;
Xorriso_lst_destroy_all;
Xorriso_lst_get_next;
Xorriso_lst_get_prev;
Xorriso_lst_get_text;
Xorriso_make_return_value;
Xorriso_msgs_submit;
Xorriso_msgs_submit_void;
Xorriso_new;
Xorriso_option_abort_on;
Xorriso_option_abstract_file;
Xorriso_option_acl;
Xorriso_option_add;
Xorriso_option_add_plainly;
Xorriso_option_alter_date;
Xorriso_option_append_partition;
Xorriso_option_application_id;
Xorriso_option_application_use;
Xorriso_option_as;
Xorriso_option_assert_volid;
Xorriso_option_auto_charset;
Xorriso_option_backslash_codes;
Xorriso_option_ban_stdio_write;
Xorriso_option_biblio_file;
Xorriso_option_blank;
Xorriso_option_boot_image;
Xorriso_option_calm_drive;
Xorriso_option_cdi;
Xorriso_option_cdx;
Xorriso_option_changes_pending;
Xorriso_option_charset;
Xorriso_option_check_md5;
Xorriso_option_check_media;
Xorriso_option_check_media_defaults;
Xorriso_option_chgrpi;
Xorriso_option_chmodi;
Xorriso_option_chowni;
Xorriso_option_clone;
Xorriso_option_close;
Xorriso_option_close_damaged;
Xorriso_option_close_filter_list;
Xorriso_option_commit;
Xorriso_option_commit_eject;
Xorriso_option_compare;
Xorriso_option_compliance;
Xorriso_option_concat;
Xorriso_option_copyright_file;
Xorriso_option_cp_clone;
Xorriso_option_cpri;
Xorriso_option_cpx;
Xorriso_option_cut_out;
Xorriso_option_data_cache_size;
Xorriso_option_dev;
Xorriso_option_devices;
Xorriso_option_dialog;
Xorriso_option_disk_dev_ino;
Xorriso_option_disk_pattern;
Xorriso_option_displacement;
Xorriso_option_drive_class;
Xorriso_option_dummy;
Xorriso_option_dvd_obs;
Xorriso_option_early_drive_test;
Xorriso_option_ecma119_map;
Xorriso_option_eject;
Xorriso_option_end;
Xorriso_option_errfile_log;
Xorriso_option_error_behavior;
Xorriso_option_external_filter;
Xorriso_option_extract;
Xorriso_option_extract_cut;
Xorriso_option_file_name_limit;
Xorriso_option_file_size_limit;
Xorriso_option_find;
Xorriso_option_follow;
Xorriso_option_fs;
Xorriso_option_getfacli;
Xorriso_option_gid;
Xorriso_option_grow_blindly;
Xorriso_option_hardlinks;
Xorriso_option_help;
Xorriso_option_hfsplus;
Xorriso_option_hide;
Xorriso_option_history;
Xorriso_option_iso_rr_pattern;
Xorriso_option_jigdo;
Xorriso_option_joliet;
Xorriso_option_launch_frontend;
Xorriso_option_list_arg_sorting;
Xorriso_option_list_delimiter;
Xorriso_option_list_extras;
Xorriso_option_list_formats;
Xorriso_option_list_profiles;
Xorriso_option_list_speeds;
Xorriso_option_lnsi;
Xorriso_option_load;
Xorriso_option_logfile;
Xorriso_option_lsi;
Xorriso_option_lsx;
Xorriso_option_map;
Xorriso_option_map_l;
Xorriso_option_mark;
Xorriso_option_md5;
Xorriso_option_mkdiri;
Xorriso_option_modesty_on_drive;
Xorriso_option_mount;
Xorriso_option_mount_opts;
Xorriso_option_move;
Xorriso_option_msg_op;
Xorriso_option_mvi;
Xorriso_option_no_rc;
Xorriso_option_named_pipe_loop;
Xorriso_option_not_leaf;
Xorriso_option_not_list;
Xorriso_option_not_mgt;
Xorriso_option_not_paths;
Xorriso_option_options_from_file;
Xorriso_option_osirrox;
Xorriso_option_overwrite;
Xorriso_option_pacifier;
Xorriso_option_padding;
Xorriso_option_page;
Xorriso_option_paste_in;
Xorriso_option_path_list;
Xorriso_option_pathspecs;
Xorriso_option_pkt_output;
Xorriso_option_preparer_id;
Xorriso_option_print;
Xorriso_option_print_size;
Xorriso_option_prog;
Xorriso_option_prog_help;
Xorriso_option_prompt;
Xorriso_option_publisher;
Xorriso_option_pvd_info;
Xorriso_option_pwdi;
Xorriso_option_pwdx;
Xorriso_option_read_fs;
Xorriso_option_read_mkisofsrc;
Xorriso_option_reassure;
Xorriso_option_report_about;
Xorriso_option_report_el_torito;
Xorriso_option_report_system_area;
Xorriso_option_return_with;
Xorriso_option_rmi;
Xorriso_option_rockridge;
Xorriso_option_rollback;
Xorriso_option_rom_toc_scan;
Xorriso_option_rr_reloc_dir;
Xorriso_option_scdbackup_tag;
Xorriso_option_scsi_dev_family;
Xorriso_option_scsi_log;
Xorriso_option_session_log;
Xorriso_option_setfacli;
Xorriso_option_setfacl_listi;
Xorriso_option_setfattri;
Xorriso_option_setfattr_listi;
Xorriso_option_set_filter;
Xorriso_option_sh_style_result;
Xorriso_option_signal_handling;
Xorriso_option_sleep;
Xorriso_option_speed;
Xorriso_option_split_size;
Xorriso_option_status;
Xorriso_option_status_history_max;
Xorriso_option_stdio_sync;
Xorriso_option_stream_recording;
Xorriso_option_system_id;
Xorriso_option_tell_media_space;
Xorriso_option_temp_mem_limit;
Xorriso_option_toc;
Xorriso_option_toc_of;
Xorriso_option_uid;
Xorriso_option_unregister_filter;
Xorriso_option_update;
Xorriso_option_use_immed_bit;
Xorriso_option_use_readline;
Xorriso_option_version;
Xorriso_option_volid;
Xorriso_option_volset_id;
Xorriso_option_volume_date;
Xorriso_option_write_type;
Xorriso_option_xattr;
Xorriso_option_zisofs;
Xorriso_parse_line;
Xorriso_peek_outlists;
Xorriso_prescan_args;
Xorriso_process_errfile;
Xorriso_process_msg_queues;
Xorriso_program_arg_bsl;
Xorriso_pull_outlists;
Xorriso_push_outlists;
Xorriso_read_rc;
Xorriso_set_problem_status;
Xorriso_sieve_add_filter;
Xorriso_sieve_big;
Xorriso_sieve_clear_results;
Xorriso_sieve_dispose;
Xorriso_sieve_get_result;
Xorriso_start_msg_watcher;
Xorriso_startup_libraries;
Xorriso_stop_msg_watcher;
local: *;
};

View File

@ -0,0 +1,27 @@
------------------------------------------------------------------------------
http:libburnia-project.org
------------------------------------------------------------------------------
Release Engineering Check List
TEST: releng
auto_* tests could be run altogether by ./run_all_auto
manual_* tests are to be run individually and manually
LOGS: http://people.debian.org/~danchev/libburnia/logs/releng/
TEST: cppcheck - static code checker
LOGS: http://people.debian.org/~danchev/libburnia/logs/cppcheck/
TEST: medistimator - checks the dialog mode of xorriso, size estimation
facility, and its ability of processing large trees. Running this
requires some specific knowledge of how the tool works, in order to
interpret the results and compare them with these from any previous
runs. The source is heavily commented.
FILE: http://anonscm.debian.org/gitweb/?p=users/danchev/medistimator.git;a=summary
LOGS: http://people.debian.org/~danchev/libburnia/logs/medistimator/
TEST: Debian ISO image builder logs
LOGS: http://cdbuilder.debian.org/cdimage-log/
TEST: Debian build daemon logs - several hardware architectures and kernels
LOGS: http://buildd.debian.org

View File

@ -0,0 +1,297 @@
------------------------------------------------------------------------------
http:libburnia-project.org
------------------------------------------------------------------------------
libisoburn/releng. By George Danchev <danchev@spnet.net>
and Thomas Schmitt <scdbackup@gmx.net>
Test suite for xorriso and libburnia libraries.
Copyright (C) 2011 - 2012 George Danchev, Thomas Schmitt
Provided under GPL version 2 or later.
------------------------------------------------------------------------------
The impatient tester will build libisoburn according to its README and then do
cd ./releng
./run_all_auto -x ../xorriso/xorriso
More patient testers will first read the following description.
Those who simply lack the interpreter /bin/bash, may do
./change_shell_to_use
and then retry.
The test suite
Directory ./releng of libisoburn contains a collection of test scripts and
auxiliary data. They exercise some typical use cases of building libisoburn
applications and running the ISO 9660 filesystem manipulation and CD/DVD/BD
burn program xorriso.
It is assumed that libburn and libisofs are installed, so that libisoburn
can be configured and built. It is not mandatory that libisoburn is already
installed. The tests may use an installed xorriso program as well as a
freshly built one.
The test scripts explicitely demand /bin/bash as interpreter, although they
would run on certain other shells too. If you get an error message like
./run_all_auto: not found
then consider to install /bin/bash.
If you decide against that, see below "Alternative Shells".
There are two groups of test scripts:
auto_* gets started and watched by script run_all_auto.
These tests have a moderate resource consumption and do
not cause mechanical movements of drive trays.
manual_* gets started by the user if desired.
Manual tests may create larger sets of temporary files,
may download test data from the internet, may need
system privileges beyond the reach of a sandbox user,
and operate the mechanics of a CD drive.
Running automated tests
The test scripts expect to get run while the working directory is
./releng
of a libisoburn source tree. E.g.: libisoburn-1.1.4/releng
They create all their temporary files underneath
./releng/releng_generated_data
Some of these files are persistent between tests.
Nevertheless it is safe to empty ./releng/releng_generated_data after
tests are done. The directory itself must be kept.
To run the unobtrusive automatic tests, build libisoburn and xorriso,
go to directory ./releng, and execute
./run_all_auto -x ../xorriso/xorriso
or if you want to use an installed xorriso program:
./run_all_auto -x $(which xorriso)
./run_all_auto -x $(type -p xorriso)
There are several options which work with run_all_auto and any single test.
-x absolute or relative path to xorriso binary to be run.
-k keep self-generated data.
-c cleanup temporary data kept from previous run and exit.
-f simulate failure.
-h print this help text.
-- end of general options, begin of test specific options.
After option "--", there may be given options which are specific to
particular manually executable test scripts.
Manually executable tests
Currently there are the following tests which should have the attention of
the user or require sysadmin considerations before they are run:
./manual_devices -x ../xorriso/xorriso [-- [--dev device_file_to_use]
[--priv_cmd 'command [arg [arg ...]]']]
Exercises listing of all accessible optical drives and the examination of
a one of these drives. The user needs the permission to operate the CD
drives. This might involve the need for superuser authority.
The media tray of the examined drive will get loaded if it is not already.
If no option --dev is given, then the user gets asked which of the listed
drives to examine more closely.
If a privilege command and optional arguments are given with --priv_cmd,
then this command and arguments are used to launch the xorriso runs.
Command and arguments must be single words and be submitted altogether
as one single argument. On Solaris use: --priv_cmd pfexec
./manual_burn -x ../xorriso/xorriso [-- [--dev device_file_to_use]
[--priv_cmd 'command [arg [arg ...]]']
[--what ...directory...] [--any_media]]
Burns the content of the directory given with --what onto re-usable