Compare commits
4 Commits
release-1.
...
ZeroSixFou
Author | SHA1 | Date | |
---|---|---|---|
3a4a03a4c6 | |||
ba5c0c7be9 | |||
7436e99f5e | |||
d2b130c079 |
@ -1,8 +1,8 @@
|
||||
Mario Danic <mario.danic@gmail.com>,
|
||||
Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
libisoburn is Copyright (C) 2007-2017 Vreixo Formoso, Thomas Schmitt
|
||||
xorriso is Copyright (C) 2007-2017 Thomas Schmitt
|
||||
libisoburn is Copyright (C) 2007-2010 Vreixo Formoso, Thomas Schmitt
|
||||
xorriso is Copyright (C) 2007-2010 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
|
||||
|
494
ChangeLog
494
ChangeLog
@ -1,495 +1,9 @@
|
||||
libisoburn-1.5.6.tar.gz Wed Jun 07 2023
|
||||
===============================================================================
|
||||
* Bug fix: False -status failure with -boot_image --interval:appended_partition
|
||||
* Bug fix: -no_rc prevented pre-scanning of arguments for stdio output and
|
||||
others. Introduced by mistake in a62f6af5, 2011.10.18.162119.
|
||||
* Bug fix: -not_leaf and -not_paths were not applied to -extract and alike
|
||||
* Bug fix: -report_system_area cmd misperceived -part_like_isohybrid with
|
||||
-isohybrid-gpt-basdat
|
||||
* Bug fix: -report_system_area cmd misperceived combination of isohybrid and
|
||||
appended partition in GPT
|
||||
* Bug fix: -as mkisofs option -part_like_isohybrid did not cause a MBR
|
||||
partition table if the partitions are data files in the ISO
|
||||
rather than appended
|
||||
* Bug fix: Split file directories (-split_size) were created with wrong
|
||||
permissions
|
||||
* Bug fix: libisofs did not mark clones of imported files as imported.
|
||||
This could cause that original and clone occupy data storage
|
||||
in the newly written session. Thanks to Ivan Shmakov.
|
||||
* Bug fix: Partition offset was preserved from -indev rather than from -outdev
|
||||
* Bug fix: libisofs could misrepresent Rock Ridge information if many
|
||||
symbolic links or AAIP data were recorded in a directory
|
||||
* Bug fix: Data files named /boot.catalog or ./boot.cat could be left out of
|
||||
the emerging ISO if the boot catalog was set to be hidden
|
||||
* Bug fix: -toc reported wrong track LBA with overwritable media with
|
||||
unrecognized content (pseudo-closed)
|
||||
* Bug fix: -find test -has_xattr matched "isofs." attributes
|
||||
in -xattr mode "any"
|
||||
* New API call isoburn_assess_written_features()
|
||||
* New API calls isoburn_igopt_set_max_ce_entries(),
|
||||
isoburn_igopt_get_max_ce_entries()
|
||||
* New flag bit12 with isoburn_read_iso_head():
|
||||
Read even if start of multi-session emulation is damaged
|
||||
* New -boot_image settings gpt_iso_bootable= and gpt_iso_not_ro=
|
||||
* New -as mkisofs options --gpt-iso-bootable and --gpt-iso-not-ro
|
||||
* New -as cdrecord option --obs_pad. Automatic no_emul_toc with -as cdrecord.
|
||||
* New parameters "obs_pad" and "bdr_obs_exempt" for -dvd_obs
|
||||
* New -as cdrecord option --bdr_obs_exempt
|
||||
* New command -assess_indev_features
|
||||
* New -find test -size
|
||||
* New -compliance rules max_ce_entries=, max_ce_drop=
|
||||
* Allowed lseekable device files with -cut_out.
|
||||
Proof-of-concept by Ivan Shmakov on bugs.debian.org. (Closes: #1010098)
|
||||
|
||||
libisoburn-1.5.4.tar.gz Sat Jan 30 2021
|
||||
===============================================================================
|
||||
* Bug fix: -report_system_area as_mkisofs misrepresented GPT with appended
|
||||
partition and forced boot flag as -part_like_isohybrid
|
||||
* Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely
|
||||
given but not containing a slash character
|
||||
* New helper script xorriso-dd-target
|
||||
* New command -truncate_overwritable
|
||||
* Switched to usage of libjte-2.0.0
|
||||
* New -jigdo parameters "checksum_algorithm", "demand_checksum",
|
||||
"-checksum-list"
|
||||
* New -as mkisofs options "-jigdo-checksum-algorithm", "-checksum-list",
|
||||
"-jigdo-force-checksum"
|
||||
* New -read_speed prefixes "soft_force:" and "soft_corr:"
|
||||
* New -check_media option data_to="-" for standard output
|
||||
* New -zisofs parameters version_2=, block_size_v2=, max_bpt=, max_bpt_f=,
|
||||
bpt_target=, bpt_free_ratio=, by_magic=v2, susp_z2=
|
||||
* New -as mkisofs options --zisofs-version-2, --zisofs2-susp-z2,
|
||||
--zisofs2-susp-zf
|
||||
* Enabled recognition of zisofs by magic without zlib support
|
||||
* New -osirrox option sparse= controls extraction into sparse files
|
||||
* New libisoburn extension options isoburn_ropt_map_joliet_stripped and
|
||||
isoburn_ropt_map_joliet_unmapped
|
||||
* New command -joliet_map
|
||||
* New command -extract_boot_images
|
||||
* New API call isoburn_ropt_get_tree_loaded()
|
||||
|
||||
libisoburn-1.5.2.tar.gz Sat Oct 26 2019
|
||||
===============================================================================
|
||||
* Bug fix: -disk_pattern on -add ./ -- mistook "./" for the root directory
|
||||
Thanks JBThiel.
|
||||
* Bug fix: -disk_pattern on -add "" -- yielded SIGSEGV
|
||||
* Bug fix: -osirrox "concat_split_on" worked only together with -split_size
|
||||
larger than 0. Thanks William Willems.
|
||||
* New command -drive_access, new -as cdrecord option --drive_not_exclusive
|
||||
* New API calls isoburn_igopt_set_part_type_guid(),
|
||||
isoburn_igopt_get_part_type_guid(), isoburn_igopt_set_iso_type_guid(),
|
||||
isoburn_igopt_get_iso_type_guid()
|
||||
* Enabled GPT type GUIDs with -append_partition,
|
||||
-boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type
|
||||
* Made libisoburn and GNU xorriso ready for building out-of-source.
|
||||
Thanks Ross Burton.
|
||||
|
||||
libisoburn-1.5.0.tar.gz Sat Sep 15 2018
|
||||
===============================================================================
|
||||
* Bug fix: Multi-session emulation was not recognized with non-zero partition
|
||||
offset
|
||||
* New bit10 of isoburn_drive_aquire() to accept all xattr namespaces
|
||||
* New -xattr mode "any" to process all xattr namespaces of local filesystem
|
||||
* New -as mkisofs option --xattr-any
|
||||
* New -as mkisofs options -uid and -gid
|
||||
|
||||
libisoburn-1.4.8.tar.gz Tue Sep 12 2017
|
||||
===============================================================================
|
||||
* Bug fix: -as mkisofs -no-emul-boot without -boot-load-size defaulted to
|
||||
size 4, instead of full boot image size
|
||||
* Bug fix: -read_fs "norock" did not prevent reading of root Rock Ridge info
|
||||
* Bug fix: Mix of absolute and relative disk paths could cause SIGSEGV with
|
||||
pattern expansion
|
||||
* Bug fix: --mbr-force-bootable did not get into effect with -append_partition
|
||||
* Bug fix: Exit value of failed -mount command was reported as 0
|
||||
* Bug fix: -boot_image actions "keep" and "patch" did not work any more.
|
||||
Regression by libisofs 1.4.4.
|
||||
* New -find tests -maxdepth and -mindepth
|
||||
* New commands -update_lxi and -update_li
|
||||
* New API calls isoburn_igopt_set_iso_mbr_part_type(),
|
||||
isoburn_igopt_get_iso_mbr_part_type()
|
||||
* New -boot_image bootspec iso_mbr_part_type=
|
||||
* New -as mkisofs option -iso_mbr_part_type
|
||||
* New -as mkisofs option -eltorito-platform
|
||||
* Properly refusing on Pseudo Overwritable formatted BD-R
|
||||
|
||||
libisoburn-1.4.6.tar.gz Fri Sep 16 2016
|
||||
===============================================================================
|
||||
* 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.
|
||||
* Bug fix: -file_size_limit did not increase ISO level if necessary.
|
||||
Thanks to Mattias Schlenker.
|
||||
* New API calls isoburn_igopt_set_gpt_guid(), isoburn_igopt_get_gpt_guid()
|
||||
* 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
|
||||
SVN trunk (to become libisoburn-0.6.6.pl00.tar.gz)
|
||||
===============================================================================
|
||||
libisoburn novelties:
|
||||
* New isoburn_ropt_set_extensions() option isoburn_ropt_nomd5tag
|
||||
- none yet -
|
||||
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
|
||||
- none yet -
|
||||
|
||||
libisoburn-0.6.4.pl00.tar.gz Tue Oct 26 2010
|
||||
===============================================================================
|
||||
@ -535,7 +49,7 @@ xorriso novelties:
|
||||
* 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 options -copright_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
|
||||
|
87
Makefile.am
87
Makefile.am
@ -1,8 +1,4 @@
|
||||
|
||||
# Copyright (C) 2006 - 2008 Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
# Copyright (C) 2008 - 2019 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Provided under GPL version 2 or later.
|
||||
|
||||
# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4
|
||||
# was: pkgconfigdir=$(libdir)/pkgconfig
|
||||
pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
|
||||
@ -10,13 +6,12 @@ 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)
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
libisoburn_libisoburn_la_SOURCES = \
|
||||
libisoburn/isoburn.h \
|
||||
libisoburn/libisoburn.h \
|
||||
@ -76,10 +71,10 @@ libisoburn_libisoburn_la_SOURCES = \
|
||||
xorriso/filters.h \
|
||||
xorriso/filters.c \
|
||||
xorriso/xorriso_timestamp.h \
|
||||
xorriso/xorriso_buildstamp.h
|
||||
xorriso/xorriso_buildstamp.h \
|
||||
version.h
|
||||
|
||||
libisoburn_libisoburn_la_LIBADD = \
|
||||
$(THREAD_LIBS) \
|
||||
-lisofs \
|
||||
-lburn
|
||||
|
||||
@ -134,7 +129,7 @@ install-exec-hook:
|
||||
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)"
|
||||
$(LIBBURNIA_LDCONFIG_CMD) "$(DESTDIR)$(libdir)" || echo 'NOTE: Explicite dynamic library configuration failed. If needed, configure manually for:' "$(DESTDIR)$(libdir)"
|
||||
|
||||
|
||||
# Alternative to the disabled .PHONY above.
|
||||
@ -144,20 +139,11 @@ 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.
|
||||
# For now make buildstamped has to be performed explicitely.
|
||||
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 = \
|
||||
@ -180,14 +166,6 @@ 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, and xorriso-dd-target if on Linux kernel
|
||||
bin_SCRIPTS = \
|
||||
frontend/xorriso-tcltk \
|
||||
$(XORRISO_DD_TARGET)
|
||||
|
||||
EXTRA_SCRIPTS = xorriso-dd-target/xorriso-dd-target
|
||||
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
## Build documentation (You need Doxygen for this to work)
|
||||
@ -241,51 +219,16 @@ indent: $(indent_files)
|
||||
nodist_pkgconfig_DATA = \
|
||||
libisoburn-1.pc
|
||||
|
||||
man_MANS = \
|
||||
xorriso/xorriso.1 \
|
||||
xorriso/xorrisofs.1 \
|
||||
xorriso/xorrecord.1 \
|
||||
xorriso/xorriso-tcltk.1 \
|
||||
$(XORRISO_DD_TARGET_MAN)
|
||||
man_MANS = xorriso/xorriso.1
|
||||
|
||||
EXTRA_MANS = xorriso-dd-target/xorriso-dd-target.1
|
||||
|
||||
info_TEXINFOS = \
|
||||
xorriso/xorriso.texi \
|
||||
xorriso/xorrisofs.texi \
|
||||
xorriso/xorrecord.texi \
|
||||
xorriso/xorriso-tcltk.texi \
|
||||
xorriso-dd-target/xorriso-dd-target.texi
|
||||
|
||||
# xorriso-dd-target.texi is hardcoded for now because of
|
||||
# Makefile.am: error: texinfo file '@XORRISO_DD_TARGET_TEXI@' has
|
||||
# unrecognized extension
|
||||
# $(XORRISO_DD_TARGET_TEXI)
|
||||
#
|
||||
# EXTRA_TEXINFOS = xorriso-dd-target/xorriso-dd-target.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
|
||||
info_TEXINFOS = xorriso/xorriso.texi
|
||||
|
||||
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 \
|
||||
xorriso-dd-target/xorriso-dd-target \
|
||||
README \
|
||||
AUTHORS \
|
||||
CONTRIBUTORS \
|
||||
@ -298,22 +241,6 @@ EXTRA_DIST = \
|
||||
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)
|
||||
|
||||
|
||||
|
146
README
146
README
@ -4,9 +4,8 @@
|
||||
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.5.6.tar.gz
|
||||
Copyright (C) 2006-2009 Vreixo Formoso,
|
||||
Copyright (C) 2006-2023 Thomas Schmitt.
|
||||
http://files.libburnia-project.org/releases/libisoburn-0.6.4.pl00.tar.gz
|
||||
Copyright (C) 2006-2010 Vreixo Formoso, Thomas Schmitt.
|
||||
Provided under GPL version 2 or later.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -25,8 +24,7 @@ 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).
|
||||
and on OpenSolaris (tested with kernel 5.11).
|
||||
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.
|
||||
|
||||
@ -36,17 +34,17 @@ By using this software you agree to the disclaimer at the end of this text:
|
||||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Dynamic library and compile time header requirements for libisoburn-1.5.6 :
|
||||
- libburn.so.4 , version libburn-1.5.6 or higher
|
||||
- libisofs.so.6 , version libisofs-1.5.6 or higher
|
||||
Dynamic library and compile time header requirements for libisoburn-0.6.4 :
|
||||
- libburn.so.4 , version libburn-0.8.8 or higher
|
||||
- libisofs.so.6 , version libisofs-0.6.38 or higher
|
||||
libisoburn and xorriso will not start with libraries which are older than their
|
||||
include headers seen at compile time.
|
||||
|
||||
Obtain libisoburn-1.5.6.tar.gz, take it to a directory of your choice
|
||||
Obtain libisoburn-0.6.4.pl00.tar.gz, take it to a directory of your choice
|
||||
and do:
|
||||
|
||||
tar xzf libisoburn-1.5.6.tar.gz
|
||||
cd libisoburn-1.5.6
|
||||
tar xzf libisoburn-0.6.4.pl00.tar.gz
|
||||
cd libisoburn-0.6.4
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
@ -70,13 +68,6 @@ 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
|
||||
|
||||
@ -90,30 +81,20 @@ 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
|
||||
By default xorriso will depend on libreadline if the readline-dev headers
|
||||
are present. This dependcy 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
|
||||
|
||||
Never omit the "make clean" command after switching libreadline enabling.
|
||||
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-xattr avoid use of xattr functions like listxattr()
|
||||
--disable-zlib avoid use of zlib functions like compress2()
|
||||
--disable-libjte avoid use of libjte for -jigdo command
|
||||
|
||||
@ -158,87 +139,30 @@ 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
|
||||
https://dev.lovelyhq.com/libburnia/libisoburn/blob/master/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
|
||||
On Linux and FreeBSD 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
|
||||
resp. by xorriso API call
|
||||
Xorriso_option_devices()
|
||||
or by libburn API call
|
||||
resp. 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.
|
||||
If you cannot get rid of the automounter that easily, 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.
|
||||
Better try to unmount an eventually mounted media before a write run.
|
||||
|
||||
|
||||
Besides true optical drives, libisoburn can also address disk files as input or
|
||||
@ -250,31 +174,8 @@ Note: xorriso by default prefixes "stdio:" to addresses outside the /dev tree
|
||||
if they do not lead to an optical drive device file.
|
||||
|
||||
|
||||
xorriso-dd-target
|
||||
|
||||
libisoburn comes with a script named
|
||||
xorriso-dd-target/xorriso-dd-target
|
||||
which uses the util-linux program lsblk to find suitable hard-disk-like
|
||||
target devices for copying hard-disk bootable ISO images onto them. Such images
|
||||
are offered by GNU/Linux distributions for installing their system.
|
||||
|
||||
xorriso-dd-target gets installed only if ./configure detects to run on a
|
||||
GNU/Linux system. It refuses to start on non-Linux kernels or if program lsblk
|
||||
is not found in /usr/sbin, /sbin, /usr/bin, /bin.
|
||||
|
||||
For introduction, examples, and details see in the build directory
|
||||
man xorriso-dd-target/xorriso-dd-target.1
|
||||
info xorriso-dd-target/xorriso-dd-target.info
|
||||
|
||||
|
||||
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
|
||||
@ -323,7 +224,7 @@ libburnia-project.org
|
||||
By Mario Danic <mario.danic@gmail.com>,
|
||||
Vreixo Formoso <metalpain2002@yahoo.es>
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2019 Mario Danic, Vreixo Formoso, Thomas Schmitt.
|
||||
Copyright (C) 2006-2010 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
|
||||
@ -339,6 +240,3 @@ Libburn. By Derek Foreman <derek@signalmarketing.com> and
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
libisoburn does not stem from their code.
|
||||
|
||||
The libisoburn release contains xorriso-dd-target
|
||||
Copyright (C) 2019 Nio Wiklund alias sudodus, Thomas Schmitt
|
||||
|
||||
|
222
acinclude.m4
222
acinclude.m4
@ -1,8 +1,3 @@
|
||||
dnl Copyright (C) 2008 - 2019 Thomas Schmitt <scdbackup@gmx.net>
|
||||
dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
|
||||
dnl Provided under GPL version 2 or later.
|
||||
|
||||
|
||||
AC_DEFUN([LIBBURNIA_SET_FLAGS],
|
||||
[
|
||||
case $target_os in
|
||||
@ -10,10 +5,6 @@ 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
|
||||
@ -27,48 +18,28 @@ AC_DEFUN([TARGET_SHIZZLE],
|
||||
|
||||
AC_MSG_CHECKING([target operating system])
|
||||
|
||||
libburn_check_libcam=
|
||||
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
|
||||
libburn_check_libcam=yes
|
||||
;;
|
||||
*-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])
|
||||
|
||||
if test x"$libburn_check_libcam" = xyes
|
||||
then
|
||||
LIBBURNIA_CHECK_LIBCAM
|
||||
fi
|
||||
AC_MSG_RESULT([$ARCH])
|
||||
])
|
||||
|
||||
|
||||
@ -169,56 +140,6 @@ iconv_close(cd);
|
||||
])
|
||||
|
||||
|
||||
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.
|
||||
@ -241,13 +162,14 @@ hl= history_list();
|
||||
)
|
||||
])
|
||||
|
||||
|
||||
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
|
||||
dnl Check for the essential gestures of libisofs/util.c
|
||||
AC_MSG_CHECKING([for desired functions in libreadline])
|
||||
readline_msg=
|
||||
libburnia_save_LIBS="$LIBS"
|
||||
@ -278,15 +200,13 @@ 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=$srcdir/libisoburn/libisoburn.ver"
|
||||
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
|
||||
if test x$vers_libs_test = xno
|
||||
then
|
||||
LIBLDFLAGS="-Wl,--version-script=$srcdir/libisoburn/libisoburn.ver"
|
||||
LDFLAGS="$libburnia_save_LDFLAGS"
|
||||
fi
|
||||
LDFLAGS="$libburnia_save_LDFLAGS"
|
||||
AC_SUBST(LIBLDFLAGS)
|
||||
])
|
||||
|
||||
|
||||
@ -341,133 +261,3 @@ dnl For debugging only
|
||||
|
||||
])
|
||||
|
||||
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.
|
||||
dnl "silent" is like "optional" but without message.
|
||||
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
|
||||
if test x"$1" = xoptional
|
||||
then
|
||||
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
|
||||
fi
|
||||
LIBBURN_ARCH_LIBS=""
|
||||
fi
|
||||
else
|
||||
if test x"$1" = xsilent
|
||||
then
|
||||
dummy=dummy
|
||||
else
|
||||
echo "enabled linking with $LIBBURN_ARCH_LIBS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl LIBBURNIA_CHECK_LINUX_SCSI is by Thomas Schmitt, libburnia project
|
||||
dnl
|
||||
AC_DEFUN([LIBBURNIA_CHECK_LINUX_SCSI],
|
||||
[
|
||||
dnl Check whether it is a Linux without scsi/scsi.h
|
||||
libburn_scsi_disabled=
|
||||
if test x"$ARCH" = xlinux
|
||||
then
|
||||
AH_TEMPLATE([Libburn_use_sg_dummY],
|
||||
[Define to compile without OS specific SCSI features])
|
||||
AC_MSG_CHECKING([for missing scsi/scsi.h on Linux])
|
||||
AC_TRY_COMPILE([
|
||||
#ifdef __linux
|
||||
#include <scsi/scsi.h>
|
||||
#endif
|
||||
],
|
||||
[;],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
|
||||
libburn_scsi_disabled=yes
|
||||
AC_MSG_RESULT([yes])]
|
||||
)
|
||||
fi
|
||||
if test x"$libburn_scsi_disabled" = xyes
|
||||
then
|
||||
echo "disabled operation of optical drives via SCSI"
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl LIBBURNIA_CHECK_LIBCAM is by Thomas Schmitt, libburnia project
|
||||
dnl
|
||||
AC_DEFUN([LIBBURNIA_CHECK_LIBCAM],
|
||||
[
|
||||
dnl Check whether libcam is requested for FreeBSD kernel but missing
|
||||
libburn_scsi_disabled=
|
||||
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
|
||||
then
|
||||
AH_TEMPLATE([Libburn_use_sg_dummY],
|
||||
[Define to compile without OS specific SCSI features])
|
||||
AC_MSG_CHECKING([for missing libcam for SCSI on FreeBSD kernel])
|
||||
dnl If libcam is not available, LIBBURN_ARCH_LIBS will be made empty
|
||||
LIBBURNIA_CHECK_ARCH_LIBS(silent)
|
||||
if test x"$LIBBURN_ARCH_LIBS" = x
|
||||
then
|
||||
AC_DEFINE([Libburn_use_sg_dummY], [yes])
|
||||
libburn_scsi_disabled=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
fi
|
||||
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
|
||||
then
|
||||
AC_MSG_CHECKING([for missing libcam headers])
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#include <camlib.h>
|
||||
#include <cam/scsi/scsi_message.h>
|
||||
#include <cam/scsi/scsi_pass.h>
|
||||
],
|
||||
[;],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
|
||||
libburn_scsi_disabled=yes
|
||||
AC_MSG_RESULT([yes])]
|
||||
)
|
||||
fi
|
||||
if test x"$libburn_scsi_disabled" = xyes
|
||||
then
|
||||
echo "disabled operation of optical drives via SCSI"
|
||||
fi
|
||||
])
|
||||
|
||||
|
@ -1,11 +1,7 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
aclocal -I .
|
||||
aclocal
|
||||
libtoolize --copy --force
|
||||
autoconf
|
||||
|
||||
# Not with libisoburn
|
||||
# autoheader
|
||||
|
||||
automake --foreign --add-missing --copy --include-deps
|
||||
|
||||
|
286
configure.ac
286
configure.ac
@ -1,4 +1,4 @@
|
||||
AC_INIT([libisoburn], [1.5.6], [http://libburnia-project.org])
|
||||
AC_INIT([libisoburn], [0.6.4], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
@ -8,10 +8,9 @@ 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 /AC_INIT(
|
||||
dnl /ISOBURN_.*_VERSION
|
||||
dnl /LT_.*
|
||||
dnl /LIB.*_REQUIRED
|
||||
@ -22,9 +21,9 @@ 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=5
|
||||
ISOBURN_MICRO_VERSION=6
|
||||
ISOBURN_MAJOR_VERSION=0
|
||||
ISOBURN_MINOR_VERSION=6
|
||||
ISOBURN_MICRO_VERSION=4
|
||||
|
||||
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
|
||||
|
||||
@ -37,16 +36,16 @@ dnl Libtool versioning
|
||||
dnl Generate libisoburn.so.1.x.y
|
||||
dnl SONAME will become LT_CURRENT - LT_AGE
|
||||
dnl
|
||||
dnl ts C30607
|
||||
dnl This is the release version 1.5.6 = libisoburn.so.1.113.0
|
||||
dnl ts B01026
|
||||
dnl This is the release version 0.6.4 = libisoburn.so.1.53.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 = 114 - 113 = 1 . Library name = libisoburn.so.1.113.0
|
||||
dnl SONAME = 54 - 53 = 1 . Library name = libisoburn.so.1.53.0
|
||||
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
|
||||
LT_CURRENT=114
|
||||
LT_AGE=113
|
||||
LT_CURRENT=54
|
||||
LT_AGE=53
|
||||
LT_REVISION=0
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
@ -59,12 +58,12 @@ AC_SUBST(LT_CURRENT_MINUS_AGE)
|
||||
AC_PREFIX_DEFAULT([/usr/local])
|
||||
test "$prefix" = "NONE" && prefix=$ac_default_prefix
|
||||
|
||||
dnl ts B90405 : Disabled on advise of Ross Burton
|
||||
dnl AM_MAINTAINER_MODE
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl Large file support
|
||||
AC_SYS_LARGEFILE
|
||||
@ -93,29 +92,12 @@ fi
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AC_SUBST(LIBTOOL_DEPS)
|
||||
# LIBTOOL="$LIBTOOL --silent"
|
||||
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)
|
||||
|
||||
@ -124,31 +106,12 @@ 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
|
||||
|
||||
dnl xorriso-dd-target is addicted to the Linux kernel and util-linux lsblk
|
||||
if uname -s | grep '^Linux' >/dev/null
|
||||
then
|
||||
XORRISO_DD_TARGET=xorriso-dd-target/xorriso-dd-target
|
||||
XORRISO_DD_TARGET_MAN=xorriso-dd-target/xorriso-dd-target.1
|
||||
XORRISO_DD_TARGET_TEXI=xorriso-dd-target/xorriso-dd-target.texi
|
||||
echo "enabled installation of xorriso-dd-target/xorriso-dd-target"
|
||||
else
|
||||
XORRISO_DD_TARGET=
|
||||
XORRISO_DD_TARGET_MAN=
|
||||
XORRISO_DD_TARGET_TEXI=
|
||||
echo "disabled installation of xorriso-dd-target/xorriso-dd-target"
|
||||
fi
|
||||
AC_SUBST(XORRISO_DD_TARGET)
|
||||
AC_SUBST(XORRISO_DD_TARGET_MAN)
|
||||
AC_SUBST(XORRISO_DD_TARGET_TEXI)
|
||||
|
||||
AC_ARG_ENABLE(libreadline,
|
||||
[ --enable-libreadline Enable use of libreadline by xorriso, default=yes],
|
||||
@ -172,31 +135,9 @@ dnl The X= in the yes case prevents that -lreadline gets linked twice
|
||||
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 .
|
||||
@ -204,68 +145,32 @@ 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
|
||||
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"
|
||||
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
|
||||
AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , LIBACL_DEF= ), LIBACL_DEF= )
|
||||
else
|
||||
echo "disabled local processing of ACL"
|
||||
LIBACL_DEF=
|
||||
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.
|
||||
[ --enable-xattr Enable use of xattr by libisofs, default=yes],
|
||||
, enable_xattr=yes)
|
||||
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"
|
||||
XATTR_DEF="-DLibisofs_with_aaip_xattR"
|
||||
AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= )
|
||||
else
|
||||
echo "disabled local processing of extended file attributes"
|
||||
XATTR_DEF=
|
||||
fi
|
||||
AC_SUBST(XATTR_DEF)
|
||||
|
||||
@ -292,11 +197,11 @@ AC_SUBST(ZLIB_DEF)
|
||||
|
||||
dnl ts B00928
|
||||
AC_ARG_ENABLE(libjte,
|
||||
[ --enable-libjte Enable use of libjte >= 2.0 by xorriso, default=yes],
|
||||
[ --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_set_checksum_algorithm, , LIBJTE_DEF= ), LIBJTE_DEF= )
|
||||
AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
|
||||
else
|
||||
LIBJTE_DEF=
|
||||
fi
|
||||
@ -306,17 +211,9 @@ 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)
|
||||
[ --enable-libcdio Enable EXPERIMENTAL use of libcdio as system adapter, default=no],
|
||||
, enable_libcdio=no)
|
||||
if test x$enable_libcdio = xyes; then
|
||||
dnl Check whether there is libcdio-devel and libcdio-runtime.
|
||||
dnl If not, erase this macro
|
||||
@ -326,20 +223,11 @@ dnl The empty yes case obviously causes -lcdio to be linked
|
||||
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 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"
|
||||
@ -362,41 +250,15 @@ else
|
||||
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-64k 64 KB default size for xorriso DVD/BD 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"
|
||||
echo "enabled xorriso write size default 64 KB on DVD and BD"
|
||||
else
|
||||
XORRISO_DVD_OBS_64K=
|
||||
echo "disabled xorriso write size default 64 KB on DVD"
|
||||
echo "disabled xorriso write size default 64 KB on DVD and BD"
|
||||
fi
|
||||
AC_SUBST(XORRISO_DVD_OBS_64K)
|
||||
|
||||
@ -405,7 +267,7 @@ AC_SUBST(XORRISO_DVD_OBS_64K)
|
||||
# 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 Enable strict symbol encapsulation , default=yes],
|
||||
, enable_versioned_libs=yes)
|
||||
if test x$enable_versioned_libs = xyes; then
|
||||
vers_libs_test=no
|
||||
@ -432,55 +294,37 @@ 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
|
||||
|
||||
AC_CHECK_HEADER(libburn/libburn.h)
|
||||
AC_CHECK_HEADER(libisofs/libisofs.h)
|
||||
|
||||
|
||||
# ------- 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.5.6
|
||||
LIBISOFS_REQUIRED=1.5.6
|
||||
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
|
||||
dnl Check for proper library versions
|
||||
LIBBURN_REQUIRED=0.8.8
|
||||
LIBISOFS_REQUIRED=0.6.38
|
||||
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
|
||||
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
|
||||
|
||||
# ------- Visible mark in configure : End of library check
|
||||
|
||||
|
||||
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 EXPERIMENTAL use of libcdio as system adapter"
|
||||
|
||||
dnl For some reason this check may not be done earlier or else pkg-config
|
||||
dnl is not found.
|
||||
LIBCDIO_REQUIRED=0.83
|
||||
PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
|
||||
fi
|
||||
|
||||
dnl Add compiler-specific flags
|
||||
|
||||
dnl See if the user wants aggressive optimizations of the code
|
||||
@ -489,18 +333,18 @@ AC_ARG_ENABLE(debug,
|
||||
, enable_debug=yes)
|
||||
if test x$enable_debug != xyes; then
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="-O3 $CFLAGS"
|
||||
CFLAGS="-fexpensive-optimizations $CFLAGS"
|
||||
CFLAGS="$CFLAGS -O3"
|
||||
CFLAGS="$CFLAGS -fexpensive-optimizations"
|
||||
fi
|
||||
CFLAGS="-DNDEBUG $CFLAGS"
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
else
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
|
||||
CFLAGS="$CFLAGS -g -pedantic -Wall"
|
||||
fi
|
||||
CFLAGS="-DDEBUG $CFLAGS"
|
||||
CFLAGS="$CFLAGS -DDEBUG"
|
||||
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"
|
||||
CFLAGS="$CFLAGS $READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K"
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
|
@ -10,7 +10,7 @@ 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.
|
||||
Our scope is currently Linux 2.4 and 2.6, or FreeBSD, or OpenSolaris.
|
||||
|
||||
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
|
||||
@ -42,7 +42,7 @@ To build libisoburn go into its toplevel directory and execute:
|
||||
|
||||
- make
|
||||
|
||||
To make the library and the xorriso application accessible for running and
|
||||
To make the library and the xorriso application accessible for running resp.
|
||||
software development:
|
||||
|
||||
- make install
|
||||
@ -73,7 +73,7 @@ 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
|
||||
For the corresponding C language API see libisoburn/xorriso.h (resp.
|
||||
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
|
||||
|
@ -394,6 +394,12 @@ MAX_INITIALIZER_LINES = 30
|
||||
|
||||
SHOW_USED_FILES = YES
|
||||
|
||||
# If the sources in your project are distributed over multiple directories
|
||||
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
|
||||
# in the documentation. The default is NO.
|
||||
|
||||
SHOW_DIRECTORIES = NO
|
||||
|
||||
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
|
||||
# doxygen should invoke to get the current version for each file (typically from the
|
||||
# version control system). Doxygen will invoke the program by executing (via
|
||||
@ -694,6 +700,12 @@ HTML_FOOTER =
|
||||
|
||||
HTML_STYLESHEET =
|
||||
|
||||
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||
# files or namespaces will be aligned in HTML using tables. If set to
|
||||
# NO a bullet list will be used.
|
||||
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
|
||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||
# will be generated that can be used as input for tools like the
|
||||
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
|
||||
@ -928,6 +940,18 @@ GENERATE_XML = NO
|
||||
|
||||
XML_OUTPUT = xml
|
||||
|
||||
# The XML_SCHEMA tag can be used to specify an XML schema,
|
||||
# which can be used by a validating XML parser to check the
|
||||
# syntax of the XML files.
|
||||
|
||||
XML_SCHEMA =
|
||||
|
||||
# The XML_DTD tag can be used to specify an XML DTD,
|
||||
# which can be used by a validating XML parser to check the
|
||||
# syntax of the XML files.
|
||||
|
||||
XML_DTD =
|
||||
|
||||
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
|
||||
# dump the program listings (including syntax highlighting
|
||||
# and cross-referencing information) to the XML output. Note that
|
||||
@ -1121,8 +1145,7 @@ HIDE_UNDOC_RELATIONS = YES
|
||||
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
||||
# have no effect if this option is set to NO (the default)
|
||||
|
||||
# ts B10415: dot causes sigsegv on Debian buildd
|
||||
HAVE_DOT = NO
|
||||
HAVE_DOT = YES
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
|
424
doc/faq.wiki
424
doc/faq.wiki
@ -1,424 +0,0 @@
|
||||
|
||||
### Libburnia Frequently Asked Questions
|
||||
|
||||
Please post your questions to
|
||||
[GNU xorriso mailing list](https://lists.gnu.org/mailman/listinfo/bug-xorriso).
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
### Content:
|
||||
|
||||
Google favorites:
|
||||
|
||||
[xorriso not found](FAQ#xorriso_not_found)
|
||||
|
||||
[xorriso tutorial](FAQ#xorriso_tutorial)
|
||||
|
||||
[xorriso create ISO image](FAQ#xorriso_create_iso)
|
||||
|
||||
Burning:
|
||||
|
||||
[What is the difference between cdrskin and xorriso ?](FAQ#diff_cdrskin_xorriso)
|
||||
|
||||
[What does that SCSI error message mean ?](FAQ#scsi_error)
|
||||
|
||||
[Why is simultaneous burning with multiple drives so slow ?](FAQ#concurrent_burn)
|
||||
|
||||
Imaging:
|
||||
|
||||
[Is there a way to edit files inside the ISO image ?](FAQ#edit_files)
|
||||
|
||||
[For which architectures xorriso is able to create bootable images ?](FAQ#boot_arch)
|
||||
|
||||
[How to enable booting from USB stick ?](FAQ#isohybrid)
|
||||
|
||||
[What is partition offset feature all about?](FAQ#partition_offset)
|
||||
|
||||
[Partition offset bad on Apple ?](FAQ#partition_offset_apple)
|
||||
|
||||
Development:
|
||||
|
||||
[Where are the APIs of libburnia libraries described ?](FAQ#api_specs)
|
||||
|
||||
[I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ?](FAQ#gui_advise)
|
||||
|
||||
Miscellaneous:
|
||||
|
||||
[Where to see examples ?](FAQ#example_links)
|
||||
|
||||
[What personalities are supported by xorriso ?](FAQ#xorriso_aliases)
|
||||
|
||||
[What is xorriso dialog mode useful for ?](FAQ#xorriso_dialog_mode)
|
||||
|
||||
[Why is every second release missing ?](FAQ#version_numbers)
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
### Google favorites
|
||||
------------------------------------------------------------------------
|
||||
|
||||
##### xorriso not found <A NAME="xorriso_not_found">
|
||||
|
||||
This message is issued by programs which use [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 [GNU xorriso](http://www.gnu.org/software/xorriso#download)
|
||||
source tarball. For instructions read in its
|
||||
[README file](http://www.gnu.org/software/xorriso/README_xorriso)
|
||||
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 <A NAME="xorriso_tutorial">
|
||||
|
||||
There is not much more than the
|
||||
[man xorriso examples](http://www.gnu.org/software/xorriso/man_1_xorriso.html#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 [xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/README-tcltk)
|
||||
[(screenshot)](http://www.gnu.org/software/xorriso/xorriso-tcltk-screen.gif)
|
||||
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 [man xorriso](http://www.gnu.org/software/xorriso/man_1_xorriso.html)
|
||||
ready to learn what the particular commands mean.
|
||||
|
||||
|
||||
##### xorriso create ISO image <A NAME="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 [man xorriso](http://www.gnu.org/software/xorriso/man_1_xorriso.html)
|
||||
for xorriso native commands.
|
||||
|
||||
See [man xorrisofs](http://www.gnu.org/software/xorriso/man_1_xorrisofs.html)
|
||||
for its mkisofs emulation.
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
### Burning
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
##### What is the difference between cdrskin and xorriso ? <A NAME="diff_cdrskin_xorriso">
|
||||
|
||||
[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.
|
||||
|
||||
[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 ? <A NAME="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
|
||||
[GNU xorriso mailing list](https://lists.gnu.org/mailman/listinfo/bug-xorriso).
|
||||
|
||||
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 ? <A NAME="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 [the wiki page about this problem](ConcurrentLinuxSr) 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 ? <A NAME="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 ? <A NAME="boot_arch">
|
||||
|
||||
Currently it supports systems with PC-BIOS for booting from CD, DVD, or BD
|
||||
media, and from memory sticks or hard disks. The same feature range is
|
||||
supported for systems with EFI firmware with x86 or ARM processor.
|
||||
|
||||
Further it supports machines with MIPS processor from SGI (Big Endian)
|
||||
and DEC (Little Endian), and SUN SPARC machines.
|
||||
(See [libisofs/doc/boot_sectors.txt](https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/doc/boot_sectors.txt)
|
||||
for technical details.)
|
||||
|
||||
Examples how to get an impression of the boot equipment of existing ISO 9660
|
||||
images are on the wiki page about xorriso
|
||||
[commands -report_system_area and -report_el_torito](ReportSystemArea).
|
||||
|
||||
##### How to enable booting from USB stick ? <A NAME="isohybrid">
|
||||
|
||||
In most cases, ISOs are prepared for PC-BIOS to boot the ISOLINUX boot loader.
|
||||
This boot loader is normally started from CD, DVD or BD media 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
|
||||
[manual page of xorriso](http://www.gnu.org/software/xorriso/man_1_xorriso.html)
|
||||
option `-boot_image` with arguments `isolinux system_area=`,
|
||||
and `-as mkisofs` option `-isohybrid-mbr`.
|
||||
|
||||
See [Wikipedia on MBR](http://en.wikipedia.org/wiki/Master_boot_record) for
|
||||
general information about PC-DOS Master Boot Records, and
|
||||
[ISOLINUX wiki](http://syslinux.zytor.com/wiki/index.php/ISOLINUX) 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 [homepage of GNU GRUB 2](http://www.gnu.org/software/grub/)
|
||||
for general information.
|
||||
|
||||
EFI firmware in its native mode boots by El Torito from CD, DVD or BD media,
|
||||
and by partition table from USB stick or hard disk. Both, El Torito and
|
||||
partition table, point to a FAT filesystem image, the EFI System Partition.
|
||||
The partiton table may be either a DOS-style MBR partition table or a
|
||||
[GUID Partition Table](https://en.wikipedia.org/wiki/GUID_Partition_Table).
|
||||
The x86 program program in the MBR is ignored by EFI, which rather starts
|
||||
a program from the FAT directory "\EFI\BOOT". The name of the program file
|
||||
depends on the processor architecture: BOOTX64.EFI, BOOTIA32.EFI, BOOTARM.EFI,
|
||||
BOOTAA64.EFI for x86 64 bit, x86 32 bit, ARM 32 bit, and ARM 64 bit,
|
||||
respectively.
|
||||
|
||||
The boot equipment for other systems may well work from USB stick too.
|
||||
But libburnia project has no tangible information about this.
|
||||
|
||||
##### What is partition offset feature all about? <A NAME="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,i
|
||||
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 its 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 [Partition Offset Wiki](PartitionOffset)
|
||||
for examples.)
|
||||
|
||||
There are reports of machines which will not boot from USB stick if
|
||||
partition offset is 0.
|
||||
|
||||
##### Partition offset bad on Apple ? <A NAME="partition_offset_apple">
|
||||
|
||||
Apple's "Snow Leopard" operating system refuses to mount Debian CD images
|
||||
with non-zero partition offset.
|
||||
|
||||
The issue is not yet fully understood. 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 ? <A NAME="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 git versions of these files:
|
||||
[libburn/libburn.h](https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/libburn/libburn.h) ,
|
||||
[libisofs/libisofs.h](https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/libisofs/libisofs.h) ,
|
||||
[libisoburn/libisoburn.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/libisoburn/libisoburn.h) ,
|
||||
[libisoburn/xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/xorriso/xorriso.h)
|
||||
|
||||
##### I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ? <A NAME="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
|
||||
[man 1 xorriso](http://www.gnu.org/software/xorriso/man_1_xorriso.html)
|
||||
can be performed by a corresponding C function that is defined in
|
||||
[xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/xorriso/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.
|
||||
[See below](FAQ#xorriso_dialog_mode).
|
||||
The script
|
||||
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/xorriso-tcltk)
|
||||
demonstrates this approach. It is part of the
|
||||
libisoburn release tarball and of the GNU xorriso tarball.
|
||||
|
||||
The known existing GUIs
|
||||
[Xfburn](http://goodies.xfce.org/projects/applications/xfburn),
|
||||
[Brasero](http://projects.gnome.org/brasero/),
|
||||
[FlBurn](http://flburn.sourceforge.net/)
|
||||
rather use libisofs and libburn directly.
|
||||
(Please submit an URI if you want your libburnia GUI application mentioned
|
||||
here.)
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
### Miscellaneous
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
##### Where to see examples ? <A NAME="example_links">
|
||||
|
||||
[xorriso examples](http://www.gnu.org/software/xorriso/man_1_xorriso.html#EXAMPLES) ,
|
||||
[cdrskin examples](http://scdbackup.sourceforge.net/man_1_cdrskin_devel.html#EXAMPLES) ,
|
||||
[libburner.c a minimal but complete burn program](https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/test/libburner.c).
|
||||
|
||||
|
||||
##### What personalities are supported by xorriso ? <A NAME="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 can 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 ? <A NAME="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
|
||||
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/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 ? <A NAME="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 git version
|
||||
of `libisoburn/doc/faq.wiki`. When done, paste it into the wiki editor.
|
||||
|
@ -1,47 +0,0 @@
|
||||
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
|
||||
|
@ -6,11 +6,11 @@ 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`.
|
||||
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.
|
||||
The dual-mount feature supports Rock Ridge and eventually Joliet too.
|
||||
It is capable of multi-session.
|
||||
|
||||
Currently only offset 32 kB seems to make sense. Smaller offsets are prohibited
|
||||
@ -19,18 +19,6 @@ extend the unclaimed area into vital blocks of the ISO image.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
According to a
|
||||
[thread of march 2011](http://www.syslinux.org/archives/2011-March/016527.html)
|
||||
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
|
||||
[debian-cd thread of april 2011](http://lists.debian.org/debian-cd/2011/04/msg00029.html).
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
Example:
|
||||
|
||||
Testing mountability and ISOLINUX bootability from USB stick and CD.
|
||||
@ -40,158 +28,146 @@ 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.
|
||||
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`
|
||||
|
||||
byte pattern. In the case of RIPLinux-9.3-non-X.iso only the first 512 bytes
|
||||
are non-zero. But to avoid any assumptions, all 32 kB get copied here.
|
||||
{{{
|
||||
dd if=RIPLinux-9.3-non-X.iso bs=1K count=32 of=RIPLinux-9.3-non-X.sysarea
|
||||
}}}
|
||||
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
|
||||
Option -isohybrid-mbr imports the copied System Area and patches the MBR
|
||||
according to rules published by hpa on Syslinux mailing list.
|
||||
Option `-partition_offset 16` causes the first partition to start at 2 kB block
|
||||
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 \
|
||||
-isohybrid-mbr RIPLinux-9.3-non-X.sysarea \
|
||||
-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
|
||||
```
|
||||
/dev/sdb1 * 64 119215 59576 17 Hidden HPFS/NTFS
|
||||
}}}
|
||||
|
||||
I can mount `/dev/sdb` and `/dev/sdb1` alike:
|
||||
```
|
||||
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".
|
||||
}}}
|
||||
-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`.
|
||||
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
|
||||
```
|
||||
{{{
|
||||
-partition_offset 16 -no-pad --no-emul-toc
|
||||
}}}
|
||||
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.
|
||||
Due to options -no-pad --no-emul-toc the image is about 300 kB smaller than
|
||||
the image produced by original grub-mkrescue. Else it would have grown by
|
||||
about 130 kB.
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
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
|
||||
Currently xorriso keeps the 0x80 mark of an eventually imported MBR
|
||||
resp. the 0x80 mark which xorriso eventually sets by its own MBR
|
||||
preparations.
|
||||
- If not to be marked bootable:
|
||||
What equipment would the partition need to justify having the mark ?
|
||||
|
||||
- I am still puzzled by the cylinder-head-sector ambiguity. How does a reader
|
||||
of the partition table determine the numbers for heads/cylinder and
|
||||
sectors/head ?
|
||||
fdisk tells about my /dev/sdb
|
||||
{{{
|
||||
105 heads, 17 sectors/track, 2193 cylinders, total 3915776 sectors
|
||||
}}}
|
||||
My partiton table rather was computed with 255 heads/cylinder, 63 sectors/head
|
||||
Debian does not mind the difference. (It uses the 32 bit LBAs, i assume.)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Application:
|
||||
|
||||
The partition offset feature can be controlled by libisofs API calls
|
||||
```
|
||||
The partition offset feature can be controlled by libisofs API call
|
||||
{{{
|
||||
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
|
||||
```
|
||||
}}}
|
||||
resp. 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);
|
||||
@ -199,25 +175,14 @@ int isoburn_igopt_set_part_offset(struct isoburn_imgen_opts *opts,
|
||||
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
|
||||
```
|
||||
}}}
|
||||
resp. 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 mkisofs ... -partition_offset (2kb_block_adr) ...
|
||||
}}}
|
||||
|
||||
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.
|
||||
|
@ -1,518 +0,0 @@
|
||||
|
||||
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
|
||||
[GNU Hurd qemu page](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 [online man page of xorriso](http://scdbackup.sourceforge.net/man_1_xorriso_devel.html).
|
||||
|
||||
|
||||
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
|
||||
...
|
||||
```
|
@ -1,22 +0,0 @@
|
||||
# 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]
|
||||
|
@ -1,127 +0,0 @@
|
||||
------------------------------------------------------------------------------
|
||||
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.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
@ -1,980 +0,0 @@
|
||||
|
||||
/* 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 encountered 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);
|
||||
}
|
||||
|
@ -1,439 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2015 - 2022
|
||||
# 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.
|
||||
# This mode produces a mountable ISO 9660 partition 1 only if variable
|
||||
# MKRESCUE_SED_PROTECTIVE is empty or set to "no".
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Mode "gpt_appended" represents the same layout as "mbr_only" by GPT rather
|
||||
# than by MBR partition table. It differs from "original" by the fact that
|
||||
# option -partition_offset 16 is implied and that the first partition may
|
||||
# be used to mount the ISO 9660 filesystem. MKRESCUE_SED_PROTECTIVE is ignored,
|
||||
# because neat GPT is indicated by the existence of a Protective MBR.
|
||||
#
|
||||
# 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.4.
|
||||
# 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
|
||||
# "gpt_appended" = ESP in GPT, without HFS+
|
||||
# $mode"_copy" = one of above modes, ESP in ISO and as appended partition
|
||||
# "original" = pass arguments unchanged
|
||||
mode="mbr_only"
|
||||
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=""
|
||||
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.
|
||||
|
||||
# "yes" in MKRESCUE_SED_IN_EFI_NO_PT overwrites the MBR partition table area
|
||||
# in the EFI boot image by zeros. Some EFI implementations get stuck when
|
||||
# seeing in the EFI partition a partition table entry which begins at LBA 0.
|
||||
# "extra" not only zeros the partition table but also the MBR signature.
|
||||
efi_zero_inner_pt=no
|
||||
if test -n "$MKRESCUE_SED_IN_EFI_NO_PT"
|
||||
then
|
||||
efi_zero_inner_pt="$MKRESCUE_SED_IN_EFI_NO_PT"
|
||||
fi
|
||||
|
||||
# "yes" in MKRESCUE_SED_UNPACK_EFI_TO_ISO causes the file tree from the FAT
|
||||
# image efi.img to be unpacked by mcopy to a directory in /tmp which then
|
||||
# gets mapped into the root directory of the emerging ISO 9660 filesystem.
|
||||
# This enables a way of installing the result image onto a USB stick with
|
||||
# FAT filesystem by simply copying its full file tree from ISO to FAT.
|
||||
# Whether the payload files of the ISO will be able to work from FAT depends
|
||||
# on their expectation towards file names and attributes.
|
||||
# WARNING: Make sure that the files in efi.img do not collide with your
|
||||
# payload files or with files added to the ISO by GRUB. Before using
|
||||
# MKRESCUE_SED_UNPACK_EFI_TO_ISO, make a vanilla grub-mkrescue ISO
|
||||
# with your payload, mount it and then its /efi.img file, then use
|
||||
# program "find" on the mount point of efi.img to see all its files.
|
||||
# Compare this with the output of "find" on the ISO mount point.
|
||||
efi_unpack_to_iso=no
|
||||
if test -n "$MKRESCUE_SED_UNPACK_EFI_TO_ISO"
|
||||
then
|
||||
efi_unpack_to_iso="$MKRESCUE_SED_UNPACK_EFI_TO_ISO"
|
||||
fi
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
# Check for option -iso_mbr_part_type which is new in 1.4.8
|
||||
iso_mbr_part_type=
|
||||
if "$xorriso" -as mkisofs -help 2>&1 | grep iso_mbr_part_type >/dev/null
|
||||
then
|
||||
iso_mbr_part_type="-iso_mbr_part_type 0x00"
|
||||
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" 2>&1
|
||||
echo 2>&1
|
||||
fi
|
||||
|
||||
if test x"$efi_zero_inner_pt" = xyes -o x"$efi_zero_inner_pt" = xextra
|
||||
then
|
||||
did_dd=0
|
||||
if test -e "$dir"/efi.img
|
||||
then
|
||||
# Look for 0x55 0xAA in bytes 510 and 511
|
||||
magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \
|
||||
od -c | head -1 | awk '{print $2 " " $3}')
|
||||
if test "$magic" = "U 252"
|
||||
then
|
||||
echo "Performing actions for MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
|
||||
dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img
|
||||
did_dd=1
|
||||
if test "$efi_zero_inner_pt" = extra
|
||||
then
|
||||
dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of="$dir"/efi.img
|
||||
fi
|
||||
echo >&2
|
||||
fi
|
||||
fi
|
||||
if test "$did_dd" = 0
|
||||
then
|
||||
echo >&2
|
||||
echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2
|
||||
echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
|
||||
echo >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
efi_temp_tree=
|
||||
if test x"$efi_unpack_to_iso" = xyes
|
||||
then
|
||||
if test -e "$dir"/efi.img
|
||||
then
|
||||
temp_tree=/tmp/grub-mkrescue-sed-et."$$"
|
||||
# The mcopy command is the inverse of what grub-mkrescue does to pack it up
|
||||
if mcopy -s -i "$dir"/efi.img ::/ "$temp_tree"
|
||||
then
|
||||
efi_temp_tree="$temp_tree"
|
||||
if test x"$debug" = xyes -o x"$debug" = xextra
|
||||
then
|
||||
echo "Temporarily extracted $dir/efi.img to $temp_tree" >&2
|
||||
echo >&2
|
||||
if test x"$debug" = xextra
|
||||
then
|
||||
# Show extracted files
|
||||
find "$temp_tree" >&2
|
||||
echo >&2
|
||||
fi
|
||||
fi
|
||||
elif test -e "$temp_tree"
|
||||
then
|
||||
rm -r "$temp_tree"
|
||||
fi
|
||||
if test -z "$efi_temp_tree"
|
||||
then
|
||||
echo >&2
|
||||
echo "$0 : NOTE : Could not extract efi.img to $temp_tree" >&2
|
||||
echo "$0 : NOTE : Thus cannot obey MKRESCUE_SED_UNPACK_EFI_TO_ISO." >&2
|
||||
echo >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
efi_tmp_name=
|
||||
if test x"$mode" = xmjg \
|
||||
-o x"$mode" = xmbr_only \
|
||||
-o x"$mode" = xgpt_appended \
|
||||
-o x"$mode" = xmbr_hfs
|
||||
then
|
||||
# Move EFI partition image file out of the "$dir" tree, i.e. out of the ISO
|
||||
efi_tmp_name=grub-mkrescue-sed-ei.$$
|
||||
if test -e "$dir"/efi.img
|
||||
then
|
||||
mv "$dir"/efi.img /tmp/$efi_tmp_name
|
||||
if test x"$debug" = xyes -o x"$debug" = xextra
|
||||
then
|
||||
echo "Temporarily moved $dir/efi.img to /tmp/$efi_tmp_name" >&2
|
||||
echo >&2
|
||||
fi
|
||||
elif test -e /tmp/$efi_tmp_name
|
||||
then
|
||||
rm /tmp/$efi_tmp_name
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$mode" = xmjg
|
||||
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\/$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
|
||||
x=$(echo " $*" | sed \
|
||||
-e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -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/$iso_mbr_part_type -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
|
||||
x=$(echo " $*" | sed \
|
||||
-e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -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/$iso_mbr_part_type -no-pad -append_partition 2 0xef \/tmp\/$(basename "$dir")\/efi.img/" \
|
||||
-e "s/--protective-msdos-label/$protective/" \
|
||||
)
|
||||
|
||||
elif test x"$mode" = xgpt_appended
|
||||
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\/$efi_tmp_name -appended_part_as_gpt -partition_offset 16/" \
|
||||
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \
|
||||
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
|
||||
)
|
||||
|
||||
elif test x"$mode" = xgpt_appended_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 -appended_part_as_gpt -partition_offset 16/" \
|
||||
-e "s/-hfsplus .*CoreServices\/boot.efi//" \
|
||||
)
|
||||
|
||||
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 echo "$efi_temp_tree" | grep '^/tmp/' >/dev/null
|
||||
then
|
||||
# Does the xorriso run end in native command mode ?
|
||||
separator_seen=0
|
||||
for i in "$@"
|
||||
do
|
||||
if test x"$i" = x--
|
||||
then
|
||||
separator_seen=1
|
||||
fi
|
||||
done
|
||||
if test "$separator_seen" = 1
|
||||
then
|
||||
# Native mode possible: Enable it for sure and then use -map
|
||||
x=" $x -- -map $efi_temp_tree /"
|
||||
else
|
||||
# Hopefully nobody finds a way to leave mkisofs emulation without "--" arg
|
||||
x=" $x -graft-points /=$efi_temp_tree"
|
||||
fi
|
||||
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
|
||||
|
||||
# Remove possible extracted EFI partition tree
|
||||
if echo "$efi_temp_tree" | grep '^/tmp/' >/dev/null
|
||||
then
|
||||
rm -r "$efi_temp_tree"
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
Binary file not shown.
@ -1,304 +0,0 @@
|
||||
#!/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 unambiguously 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
@ -1,222 +0,0 @@
|
||||
#!/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
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/*
|
||||
data source for libisoburn.
|
||||
|
||||
Copyright 2007 - 2012 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
Copyright 2007 - 2010 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
@ -33,7 +33,17 @@
|
||||
#include "isoburn.h"
|
||||
|
||||
|
||||
/* Cached reading of image tree data by multiple tiles */
|
||||
/* Cached reading of image tree data */
|
||||
/* Multi tile: 32 * 64 kB */
|
||||
|
||||
/* The size of a single tile.
|
||||
Powers of 2 only ! Less than 16 makes not much sense.
|
||||
*/
|
||||
#define Libisoburn_tile_blockS 32
|
||||
|
||||
/* The number of tiles in the cache
|
||||
*/
|
||||
#define Libisoburn_cache_tileS 32
|
||||
|
||||
|
||||
/* Debugging only: This reports cache loads on stderr.
|
||||
@ -42,7 +52,7 @@
|
||||
|
||||
|
||||
struct isoburn_cache_tile {
|
||||
char *cache_data;
|
||||
char cache_data[Libisoburn_tile_blockS * 2048];
|
||||
uint32_t cache_lba;
|
||||
uint32_t last_error_lba;
|
||||
uint32_t last_aligned_error_lba;
|
||||
@ -52,24 +62,8 @@ struct isoburn_cache_tile {
|
||||
|
||||
struct isoburn_cached_drive {
|
||||
struct burn_drive *drive;
|
||||
struct isoburn_cache_tile **tiles;
|
||||
int num_tiles;
|
||||
int tile_blocks;
|
||||
struct isoburn_cache_tile tiles[Libisoburn_cache_tileS];
|
||||
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
|
||||
@ -84,11 +78,11 @@ int ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
|
||||
off_t count;
|
||||
uint32_t aligned_lba;
|
||||
char msg[80];
|
||||
struct isoburn_cache_tile **tiles;
|
||||
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
|
||||
/* It is not required by the specs of libisofs but implicitely assumed
|
||||
by its current implementation that a data source read result <0 is
|
||||
a valid libisofs error code.
|
||||
*/
|
||||
@ -109,28 +103,14 @@ int ds_read_block(IsoDataSource *src, uint32_t lba, uint8_t *buffer)
|
||||
return ISO_ASSERT_FAILURE;
|
||||
}
|
||||
|
||||
tiles = icd->tiles;
|
||||
tiles = (struct isoburn_cache_tile *) 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 & ~(Libisoburn_tile_blockS - 1);
|
||||
|
||||
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);
|
||||
for(i=0; i<Libisoburn_cache_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;
|
||||
@ -140,53 +120,73 @@ address_rollover:;
|
||||
/* find oldest tile */
|
||||
oldest_age= Libisoburn_max_agE;
|
||||
oldest= 0;
|
||||
for(i = 0; i < icd->num_tiles; i++) {
|
||||
if(tiles[i]->cache_lba == 0xffffffff) {
|
||||
for(i= 0; i<Libisoburn_cache_tileS; i++) {
|
||||
if(tiles[i].cache_lba == 0xffffffff) {
|
||||
oldest= i;
|
||||
break;
|
||||
}
|
||||
if(tiles[i]->age < oldest_age) {
|
||||
oldest_age= tiles[i]->age;
|
||||
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) {
|
||||
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);
|
||||
(char *) tiles[oldest].cache_data,
|
||||
Libisoburn_tile_blockS * 2048, &count, 2);
|
||||
}
|
||||
if (ret <= 0 ) {
|
||||
tiles[oldest]->last_aligned_error_lba = aligned_lba;
|
||||
tiles[oldest].last_aligned_error_lba = aligned_lba;
|
||||
|
||||
/* Read-ahead failure ? Try to read 2048 directly. */
|
||||
if(tiles[oldest]->last_error_lba == lba)
|
||||
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);
|
||||
tiles[oldest].last_error_lba = lba;
|
||||
|
||||
#ifdef ISO_DATA_SOURCE_MISHAP
|
||||
ret= ISO_DATA_SOURCE_MISHAP;
|
||||
#else
|
||||
/* <<< pre libisofs-0.6.7 */
|
||||
/* It is not required by the specs of libisofs but implicitely assumed
|
||||
...
|
||||
But it is not possible to ignore FAILURE.
|
||||
libisofs insists in original error codes, i.e. libisoburn cannot
|
||||
change severity FAILURE associated with ISO_FILE_READ_ERROR.
|
||||
So ISO_FILE_READ_ERROR is not an option and libisoburn has to
|
||||
misuse ISO_FILE_CANT_WRITE, which is actually for image generation
|
||||
and not for image reading.
|
||||
This is quite wrong, although the error message text is unclear
|
||||
enough to make it appear plausible.
|
||||
*/
|
||||
ret= ISO_FILE_CANT_WRITE;
|
||||
#endif
|
||||
|
||||
if(ret >= 0)
|
||||
ret = -1;
|
||||
sprintf(msg, "ds_read_block(%lu) returns %d", (unsigned long) lba, ret);
|
||||
isoburn_msgs_submit(NULL, 0x00060000, msg, 0, "DEBUG", 0);
|
||||
return ISO_DATA_SOURCE_MISHAP;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#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);
|
||||
oldest, tiles[oldest].cache_hits, aligned_lba, (int) count);
|
||||
#endif
|
||||
|
||||
tiles[oldest]->cache_lba= aligned_lba;
|
||||
tiles[oldest]->cache_hits= 1;
|
||||
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);
|
||||
memcpy(buffer, tiles[oldest].cache_data + (lba - aligned_lba) * 2048, 2048);
|
||||
count= 2048;
|
||||
|
||||
return 1;
|
||||
@ -205,107 +205,11 @@ static int ds_close(IsoDataSource *src)
|
||||
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);
|
||||
}
|
||||
/* nothing to do */;
|
||||
if(src->data != NULL)
|
||||
free(src->data);
|
||||
src->data= NULL;
|
||||
}
|
||||
|
||||
@ -322,34 +226,34 @@ int isoburn_data_source_shutdown(IsoDataSource *src, int flag)
|
||||
}
|
||||
|
||||
|
||||
IsoDataSource *isoburn_data_source_new(struct burn_drive *d,
|
||||
uint32_t displacement, int displacement_sign,
|
||||
int cache_tiles, int tile_blocks)
|
||||
IsoDataSource *isoburn_data_source_new(struct burn_drive *d)
|
||||
{
|
||||
IsoDataSource *src;
|
||||
IsoDataSource *ret;
|
||||
struct isoburn_cached_drive *icd= NULL;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
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);
|
||||
ret = malloc(sizeof(IsoDataSource));
|
||||
icd = calloc(1,sizeof(struct isoburn_cached_drive));
|
||||
if (ret == NULL || icd == NULL)
|
||||
return NULL;
|
||||
ret->refcount = 1;
|
||||
ret->read_block = ds_read_block;
|
||||
ret->open = ds_open;
|
||||
ret->close = ds_close;
|
||||
ret->free_data = ds_free_data;
|
||||
ret->data = icd;
|
||||
icd->drive = d;
|
||||
icd->current_age= 0;
|
||||
for(i= 0; i<Libisoburn_cache_tileS; i++) {
|
||||
icd->tiles[i].cache_lba = 0xffffffff;
|
||||
icd->tiles[i].cache_hits = 0;
|
||||
icd->tiles[i].last_error_lba = 0xffffffff;
|
||||
icd->tiles[i].last_aligned_error_lba = 0xffffffff;
|
||||
icd->tiles[i].age= 0;
|
||||
}
|
||||
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;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -359,11 +263,11 @@ static int ds_inc_age(struct isoburn_cached_drive *icd, int idx, int flag)
|
||||
|
||||
(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;
|
||||
for(i= 0; i<Libisoburn_cache_tileS; i++)
|
||||
(icd->tiles)[i].age= 0;
|
||||
icd->current_age= 1;
|
||||
}
|
||||
(icd->tiles)[idx]->age= icd->current_age;
|
||||
(icd->tiles)[idx].age= icd->current_age;
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,8 @@
|
||||
/*
|
||||
Class struct of libisoburn.
|
||||
|
||||
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
Copyright 2007 - 2023 Thomas Schmitt <scdbackup@gmx.net>
|
||||
|
||||
Copyright 2007 - 2010 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -13,15 +12,9 @@
|
||||
|
||||
|
||||
/* for uint8_t */
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* For emulated TOC of overwritable media.
|
||||
/* For emulated TOC of overwriteable media.
|
||||
Provides minimal info for faking a struct burn_toc_entry.
|
||||
*/
|
||||
struct isoburn_toc_entry {
|
||||
@ -29,7 +22,8 @@ struct isoburn_toc_entry {
|
||||
int track_no; /* point */
|
||||
int start_lba;
|
||||
int track_blocks;
|
||||
char *volid; /* For caching a volume id from emulated toc on overwritables */
|
||||
|
||||
char *volid; /* For caching a volume id from emulated toc on overwriteables */
|
||||
|
||||
struct isoburn_toc_entry *next;
|
||||
};
|
||||
@ -51,17 +45,6 @@ int isoburn_toc_entry_destroy(struct isoburn_toc_entry **o, int flag);
|
||||
#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 {
|
||||
|
||||
|
||||
@ -69,9 +52,9 @@ struct isoburn {
|
||||
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 */
|
||||
/* -1= inappropriate media state detected
|
||||
0= libburn multi-session media, resp. undecided yet
|
||||
1= random access media */
|
||||
int emulation_mode;
|
||||
|
||||
/* Although rarely used, libburn can operate on several
|
||||
@ -92,7 +75,7 @@ struct isoburn {
|
||||
int fabricated_msc2;
|
||||
|
||||
|
||||
/* The nwa to be used for a first session on the present kind of overwritable
|
||||
/* 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;
|
||||
@ -113,16 +96,12 @@ struct isoburn {
|
||||
*/
|
||||
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 overwritable media.
|
||||
on overwriteable media.
|
||||
*/
|
||||
struct isoburn_toc_entry *toc;
|
||||
|
||||
/* Indicator whether the most recent burn run worked :
|
||||
/* Indicator wether the most recent burn run worked :
|
||||
-1 = undetermined, ask libburn , 0 = failure , 1 = success
|
||||
To be inquired by isoburn_drive_wrote_well()
|
||||
*/
|
||||
@ -141,9 +120,6 @@ struct isoburn {
|
||||
/* 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;
|
||||
@ -165,12 +141,6 @@ struct isoburn {
|
||||
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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -224,7 +194,7 @@ int isoburn_invalidate_iso(struct isoburn *o, int flag);
|
||||
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.
|
||||
@return -1 unsuitable media, 0 generic media, 1 emulated media.
|
||||
*/
|
||||
int isoburn_find_emulator(struct isoburn **pt,
|
||||
struct burn_drive *drive, int flag);
|
||||
@ -236,7 +206,7 @@ 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
|
||||
be rounded up to the alignment necessary for the media. 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
|
||||
@ -261,27 +231,12 @@ int isoburn_get_msc2(struct isoburn *o,
|
||||
/** 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)
|
||||
|
||||
isoburn_data_source_new(struct burn_drive *d);
|
||||
|
||||
/** Disable read capabilities of a data source which was originally created
|
||||
by isoburn_data_source_new(). After this any attempt to read will yield
|
||||
@ -303,12 +258,6 @@ int isoburn_data_source_shutdown(IsoDataSource *src, int flag);
|
||||
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
|
||||
@ -316,19 +265,10 @@ int isoburn_root_defaults(IsoImage *image, int flag);
|
||||
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 */
|
||||
|
||||
unsigned int do_joliet_map:1; /* call iso_read_opts_set_joliet_map() */
|
||||
unsigned int joliet_map_mode:1; /* for iso_read_opts_set_joliet_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 */
|
||||
@ -338,7 +278,7 @@ struct isoburn_read_opts {
|
||||
unsigned int noino:1; /* Discard eventual PX inode numbers */
|
||||
|
||||
/* ts A90810 */
|
||||
unsigned int nomd5:2; /* Do not read eventual MD5 array */
|
||||
unsigned int nomd5:1; /* Do not read eventual MD5 array */
|
||||
|
||||
unsigned int preferjoliet:1;
|
||||
/*< When both Joliet and RR extensions are present, the RR
|
||||
@ -358,19 +298,11 @@ struct isoburn_read_opts {
|
||||
* Enable or disable methods to automatically choose an input charset.
|
||||
* This eventually overrides input_charset.
|
||||
*
|
||||
* bit0= set the input character set automatically from
|
||||
* bit0= allow to 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. */
|
||||
@ -388,15 +320,7 @@ struct isoburn_read_opts {
|
||||
|
||||
uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
|
||||
* the image, as reported in the PVM. */
|
||||
|
||||
int tree_loaded; /* from iso_read_image_features_tree_loaded() */
|
||||
int rr_loaded; /* from iso_read_image_features_rr_loaded */
|
||||
|
||||
|
||||
unsigned int pretend_blank:1; /* always create empty image */
|
||||
|
||||
uint32_t displacement;
|
||||
int displacement_sign;
|
||||
};
|
||||
|
||||
|
||||
@ -410,16 +334,12 @@ 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;
|
||||
@ -431,22 +351,15 @@ struct isoburn_imgen_opts {
|
||||
unsigned int session_md5 :1;
|
||||
|
||||
/* Produce and write MD5 checksums for each single IsoFile.
|
||||
See parameter "files" of iso_write_opts_set_record_md5().
|
||||
See parameter files of iso_write_opts_set_record_md5().
|
||||
*/
|
||||
unsigned int file_md5 :2;
|
||||
|
||||
/* On overwritable media or random access files do not write the first
|
||||
/* 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 */
|
||||
|
||||
/*
|
||||
@ -454,24 +367,6 @@ struct isoburn_imgen_opts {
|
||||
* 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.
|
||||
@ -485,21 +380,6 @@ struct isoburn_imgen_opts {
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
@ -534,29 +414,11 @@ struct isoburn_imgen_opts {
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
@ -572,16 +434,13 @@ struct isoburn_imgen_opts {
|
||||
/**
|
||||
* 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.
|
||||
* to preceed the RRIP fields by an ES and to preceed the AA field by ES.
|
||||
*/
|
||||
unsigned int aaip_susp_1_10 :1;
|
||||
|
||||
@ -624,7 +483,7 @@ struct isoburn_imgen_opts {
|
||||
int fifo_size;
|
||||
|
||||
|
||||
/** Output value: Block address of session start as evaluated from medium
|
||||
/** Output value: Block address of session start as evaluated from media
|
||||
and other options by libisoburn and libburn.
|
||||
If <0 : Invalid
|
||||
If >=0: Valid block number. Block size is always 2 KiB.
|
||||
@ -694,88 +553,16 @@ struct isoburn_imgen_opts {
|
||||
*/
|
||||
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;
|
||||
|
||||
/* Disk file paths of prepared images which shall be appended
|
||||
after the ISO image and described by partition table entries in a MBR.
|
||||
NULL means unused.
|
||||
/* 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];
|
||||
uint8_t appended_part_type_guids[Libisoburn_max_appended_partitionS][16];
|
||||
char *appended_partitions[4];
|
||||
uint8_t appended_part_types[4];
|
||||
|
||||
/* Flags in case that appended partitions show up in GPT:
|
||||
bit0= appended_part_type_guids[same_index] is valid
|
||||
*/
|
||||
uint8_t appended_part_gpt_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;
|
||||
|
||||
/* isoburn_igopt_set_iso_mbr_part_type()
|
||||
*/
|
||||
int iso_mbr_part_type;
|
||||
|
||||
/* isoburn_igopt_set_iso_type_guid()
|
||||
*/
|
||||
uint8_t iso_gpt_type_guid[16];
|
||||
/* bit0= iso_gpt_type_guid is valid
|
||||
*/
|
||||
int iso_gpt_flag;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* See libisoburn.h isoburn_igopt_set_max_ce_entries() */
|
||||
uint32_t max_ce_entries;
|
||||
int max_ce_entries_flag;
|
||||
};
|
||||
|
||||
|
||||
/* Alignment for session starts on overwritable media.
|
||||
/* Alignment for session starts on overwriteable media.
|
||||
(Increased from 16 to 32 blocks for aligning to BD-RE clusters.)
|
||||
*/
|
||||
#define Libisoburn_nwa_alignemenT 32
|
||||
@ -802,7 +589,7 @@ struct isoburn_imgen_opts {
|
||||
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.
|
||||
with the first session. So the media 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
|
||||
@ -815,7 +602,7 @@ struct isoburn_imgen_opts {
|
||||
((off_t) (Libisoburn_target_head_sizE/2048))
|
||||
|
||||
|
||||
/* Wrappers for emulation of TOC on overwritable media */
|
||||
/* Wrappers for emulation of TOC on overwriteable media */
|
||||
|
||||
struct isoburn_toc_track {
|
||||
/* Either track or toc_entry are supposed to be NULL */
|
||||
@ -839,7 +626,6 @@ struct isoburn_toc_disc {
|
||||
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;
|
||||
};
|
||||
|
@ -6,8 +6,8 @@
|
||||
/*
|
||||
libisofs related functions of libisoburn.
|
||||
|
||||
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
Copyright 2007 - 2020 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright 2007 - 2010 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -105,158 +105,38 @@ IsoImage *isoburn_get_attached_image(struct burn_drive *d)
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
/* @return <=0 = error , 1 = ok , 2 = no ISO filesystem found
|
||||
*/
|
||||
int isoburn_make_iso_read_opts(struct burn_drive *d,
|
||||
struct isoburn *o,
|
||||
struct isoburn_read_opts *read_opts,
|
||||
IsoReadOpts **ropts)
|
||||
{
|
||||
int ret, int_num, dummy;
|
||||
uint32_t ms_block;
|
||||
char *msg= NULL;
|
||||
|
||||
msg= calloc(1, 160);
|
||||
*ropts= NULL;
|
||||
|
||||
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.", int_num);
|
||||
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
|
||||
{ret= 2; goto ex;}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
ret = iso_read_opts_new(ropts, 0);
|
||||
if (ret < 0) {
|
||||
isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
|
||||
goto ex;
|
||||
}
|
||||
|
||||
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);
|
||||
if(read_opts->do_joliet_map)
|
||||
iso_read_opts_set_joliet_map(*ropts, read_opts->joliet_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= 1;
|
||||
ex:;
|
||||
if(ret <= 0) {
|
||||
if(*ropts != NULL)
|
||||
iso_read_opts_free(*ropts);
|
||||
*ropts= NULL;
|
||||
}
|
||||
if(msg != NULL)
|
||||
free(msg);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
/* API function. See libisoburn.h
|
||||
*/
|
||||
int isoburn_read_image(struct burn_drive *d,
|
||||
struct isoburn_read_opts *read_opts,
|
||||
IsoImage **image)
|
||||
{
|
||||
int ret, ignore_aclea= 0;
|
||||
int ret, int_num, dummy;
|
||||
IsoReadOpts *ropts= NULL;
|
||||
IsoReadImageFeatures *features= NULL;
|
||||
char *msg= NULL;
|
||||
uint32_t ms_block;
|
||||
char msg[160];
|
||||
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;}
|
||||
return 0;
|
||||
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;}
|
||||
return(-1);
|
||||
}
|
||||
if (d == NULL || status == BURN_DISC_BLANK || read_opts->pretend_blank) {
|
||||
create_blank_image:;
|
||||
@ -270,75 +150,78 @@ create_blank_image:;
|
||||
isoburn_msgs_submit(o, 0x00060000,
|
||||
"Program error: isoburn_read_image: image==NULL",
|
||||
0, "FATAL", 0);
|
||||
{ret= -1; goto ex;}
|
||||
return -1;
|
||||
}
|
||||
/* 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;
|
||||
return ret;
|
||||
}
|
||||
new_image= *image;
|
||||
} else {
|
||||
/* Blank new image for the drive */
|
||||
if(o->image != NULL)
|
||||
ignore_aclea= iso_image_get_ignore_aclea(o->image);
|
||||
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;
|
||||
return ret;
|
||||
}
|
||||
if (image != NULL) {
|
||||
if (image) {
|
||||
*image = o->image;
|
||||
iso_image_ref(*image); /*protects object from premature free*/
|
||||
}
|
||||
iso_image_set_ignore_aclea(o->image, ignore_aclea);
|
||||
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;}
|
||||
iso_image_set_ignore_aclea(*image,
|
||||
(!!(read_opts->noacl)) | ((!!read_opts->noea) << 1) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
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;}
|
||||
return -4;
|
||||
}
|
||||
|
||||
memset((char *) &ropts, 0, sizeof(ropts));
|
||||
|
||||
/* create the data source */
|
||||
ret= isoburn_make_iso_read_opts(d, o, read_opts, &ropts);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
if(ret == 2) {
|
||||
sprintf(msg, "Creating blank image.");
|
||||
ret = isoburn_disc_get_msc1(d, &int_num);
|
||||
if (ret <= 0)
|
||||
return -2;
|
||||
ms_block= int_num;
|
||||
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;
|
||||
}
|
||||
|
||||
/* Important: do not return until iso_read_opts_free() */
|
||||
|
||||
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;
|
||||
/* 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);
|
||||
return ret;
|
||||
}
|
||||
/* 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);
|
||||
iso_read_opts_set_no_md5(ropts, read_opts->nomd5);
|
||||
|
||||
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);
|
||||
|
||||
ds = isoburn_data_source_new(d);
|
||||
if(o->iso_data_source!=NULL)
|
||||
iso_data_source_unref(o->iso_data_source);
|
||||
o->iso_data_source= ds;
|
||||
@ -348,15 +231,13 @@ create_blank_image:;
|
||||
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;
|
||||
return ret;
|
||||
}
|
||||
/* Important: do not return until free(features) */
|
||||
if (image!=NULL) {
|
||||
@ -368,181 +249,8 @@ create_blank_image:;
|
||||
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);
|
||||
read_opts->tree_loaded = iso_read_image_features_tree_loaded(features);
|
||||
read_opts->rr_loaded = iso_read_image_features_rr_loaded(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_assess_written_features(struct burn_drive *d,
|
||||
struct isoburn_read_opts *read_opts,
|
||||
IsoReadImageFeatures **features,
|
||||
struct isoburn_imgen_opts **imgen_opts,
|
||||
int flag)
|
||||
{
|
||||
int ret, type, ext;
|
||||
int64_t num_value;
|
||||
void *pt_value;
|
||||
size_t pt_size;
|
||||
IsoReadOpts *ropts= NULL;
|
||||
char *msg= NULL;
|
||||
enum burn_disc_status status= BURN_DISC_BLANK;
|
||||
IsoDataSource *ds= NULL;
|
||||
struct isoburn *o= NULL;
|
||||
IsoWriteOpts *write_opts= 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 || read_opts->pretend_blank ||
|
||||
(status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL)) {
|
||||
isoburn_msgs_submit(o, 0x00060000,
|
||||
"Empty drive, unsuitable medium state, or read option 'pretend_blank'",
|
||||
0, "FAILURE", 0);
|
||||
{ret= 0; goto ex;}
|
||||
}
|
||||
|
||||
ret= isoburn_make_iso_read_opts(d, o, read_opts, &ropts);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
if(ret == 2)
|
||||
{ret= 0; goto ex;}
|
||||
|
||||
/* ??? Only if o->iso_data_source == NULL ? */
|
||||
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;
|
||||
|
||||
ret= iso_assess_written_features(ds, ropts, features, &write_opts);
|
||||
if(ret < 0) {
|
||||
isoburn_report_iso_error(ret, "Failed to assess ISO filesystem features",
|
||||
0, "FAILURE", 0);
|
||||
ret= 0; goto ex;
|
||||
}
|
||||
|
||||
ret= isoburn_igopt_new(imgen_opts, 0);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
|
||||
/* Convert features to imgen_opts */
|
||||
|
||||
if(iso_read_image_feature_named(*features, "iso_level", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
isoburn_igopt_set_level(*imgen_opts, num_value);
|
||||
ext= 0;
|
||||
if(iso_read_image_feature_named(*features, "rock_ridge", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_rockridge * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "joliet", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_joliet * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "iso1999", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_iso1999 * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "aaip", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_aaip * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "record_md5_session", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_session_md5 * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "record_md5_files", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_file_md5 * !!num_value;
|
||||
isoburn_igopt_set_extensions(*imgen_opts, ext);
|
||||
|
||||
ext= 0;
|
||||
if(iso_read_image_feature_named(*features, "omit_version_numbers", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1) {
|
||||
if((num_value & 3) == 2)
|
||||
ext|= isoburn_igopt_only_iso_versions;
|
||||
else if(num_value & 3)
|
||||
ext|= isoburn_igopt_omit_version_numbers;
|
||||
}
|
||||
if(iso_read_image_feature_named(*features, "allow_deep_paths", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_allow_deep_paths * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "allow_longer_paths", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_allow_longer_paths * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "max_37_char_filenames", NULL,
|
||||
&type, &num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_max_37_char_filenames * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "no_force_dots", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1) {
|
||||
if(num_value & 1)
|
||||
ext|= isoburn_igopt_only_iso_versions;
|
||||
if(num_value & 2)
|
||||
ext|= isoburn_igopt_no_force_dots;
|
||||
}
|
||||
if(iso_read_image_feature_named(*features, "allow_lowercase", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_allow_lowercase * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "allow_full_ascii", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_allow_full_ascii * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "joliet_longer_paths", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_joliet_longer_paths * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "rrip_version_1_10", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_rrip_version_1_10 * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "aaip_susp_1_10", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_aaip_susp_1_10 * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "allow_dir_id_ext", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_allow_dir_id_ext * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "joliet_long_names", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_joliet_long_names * !!num_value;
|
||||
if(iso_read_image_feature_named(*features, "joliet_utf16", NULL, &type,
|
||||
&num_value, &pt_value, &pt_size) == 1)
|
||||
ext|= isoburn_igopt_joliet_utf16 * !!num_value;
|
||||
isoburn_igopt_set_relaxed(*imgen_opts, ext);
|
||||
|
||||
if(iso_read_image_feature_named(*features, "untranslated_name_len", NULL,
|
||||
&type, &num_value, &pt_value, &pt_size) == 1)
|
||||
isoburn_igopt_set_untranslated_name_len(*imgen_opts, num_value);
|
||||
|
||||
ret= 1;
|
||||
ex:;
|
||||
if(msg != NULL)
|
||||
free(msg);
|
||||
if(ropts != NULL)
|
||||
iso_read_opts_free(ropts);
|
||||
if(write_opts != NULL)
|
||||
iso_write_opts_free(write_opts);
|
||||
return(ret);
|
||||
iso_read_image_features_destroy(features);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -565,34 +273,15 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
|
||||
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;
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
|
||||
ret = isoburn_find_emulator(&o, drive, 0);
|
||||
@ -608,12 +297,9 @@ int isoburn_activate_session(struct burn_drive *drive)
|
||||
(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);
|
||||
o->target_iso_head_size, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -647,83 +333,72 @@ int isoburn_get_img_partition_offset(struct burn_drive *drive,
|
||||
static int isoburn_inspect_partition(struct isoburn *o, uint32_t img_size,
|
||||
int flag)
|
||||
{
|
||||
uint8_t *mbr, *part, *buf= NULL;
|
||||
uint8_t *mbr, *part, buf[2048];
|
||||
uint32_t offst, numsec;
|
||||
struct ecma119_pri_vol_desc *pvm;
|
||||
off_t data_count;
|
||||
int ret;
|
||||
char *msg= NULL;
|
||||
char msg[160];
|
||||
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 */
|
||||
return(2); /* not an MBR */
|
||||
|
||||
/* Does the first partition entry look credible ? */
|
||||
if(part[0] != 0x80 && part[0] != 0x00)
|
||||
{ret= 2; goto ex;} /* Invalid partition status */
|
||||
return(2); /* Invalid partition status */
|
||||
if(part[1] == 0 && part[2] == 0 && part[3] == 0)
|
||||
{ret= 2; goto ex;} /* Zero C/H/S start address */
|
||||
return(2); /* 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 */
|
||||
return(2); /* Zero or unusably small partition start */
|
||||
if((offst % 4) || (numsec % 4))
|
||||
{ret= 2; goto ex;} /* Not aligned to 2k */
|
||||
return(2); /* Not aligned to 2k */
|
||||
if(numsec < 72)
|
||||
{ret= 2; goto ex;} /* No room for volume descriptors */
|
||||
return(2); /* No room for volume descriptors */
|
||||
offst/= 4;
|
||||
numsec/= 4;
|
||||
if(offst + numsec > img_size)
|
||||
{ret= 2; goto ex;} /* Partition end exceeds image end */
|
||||
if(offst + numsec != img_size)
|
||||
return(2); /* 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);
|
||||
(char*) buf, 2048, &data_count, 2);
|
||||
if(ret <= 0)
|
||||
{ret= 2; goto ex;}
|
||||
return(2);
|
||||
pvm = (struct ecma119_pri_vol_desc *) buf;
|
||||
if (strncmp((char*) pvm->std_identifier, "CD001", 5) != 0)
|
||||
{ret= 2; goto ex;} /* not a PVD */
|
||||
return(2); /* 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 */
|
||||
return(2); /* failed sanity check */
|
||||
|
||||
if(iso_read_lsb(pvm->vol_space_size, 4) + offst > img_size)
|
||||
{ret= 2; goto ex;} /* Image ends do not match plausibly */
|
||||
if(iso_read_lsb(pvm->vol_space_size, 4) + offst != img_size)
|
||||
return(2); /* 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 */
|
||||
if(offst > 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;}
|
||||
return(3);
|
||||
}
|
||||
|
||||
/* Accept partition start and adjust buffer size */
|
||||
ret= isoburn_adjust_target_iso_head(o, offst, 0);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
return(ret);
|
||||
|
||||
ret= 1;
|
||||
ex:;
|
||||
if(buf != NULL)
|
||||
free(buf);
|
||||
if(msg != NULL)
|
||||
free(msg);
|
||||
return(ret);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
@ -731,35 +406,24 @@ ex:;
|
||||
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;
|
||||
int ret, i, capacity = -1, role;
|
||||
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;}
|
||||
return -1;
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
@ -767,14 +431,7 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
|
||||
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) {
|
||||
if (capacity > 0 || role == 2) {
|
||||
/* 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;
|
||||
@ -782,27 +439,19 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
|
||||
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);
|
||||
to_read, &data_count, 2);
|
||||
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)
|
||||
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
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
/* No read capacity means blank medium */
|
||||
if(!(flag & 1))
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
{ret= 1; goto ex;}
|
||||
/* No read capacity means blank media */
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check first 64K. If 0's, the disc is treated as a blank disc, and thus
|
||||
@ -812,9 +461,8 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
|
||||
--i;
|
||||
|
||||
if (!i) {
|
||||
if(!(flag & 1))
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
{ret= 1; goto ex;}
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
return 1;
|
||||
}
|
||||
|
||||
pvm = (struct ecma119_pri_vol_desc *)(o->target_iso_head + 16 * 2048);
|
||||
@ -827,44 +475,34 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
|
||||
|| 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;}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
return ret;
|
||||
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')) {
|
||||
o->fabricated_disc_status= BURN_DISC_APPENDABLE;
|
||||
} else if (!strncmp((char*)pvm->std_identifier, "CDXX1", 5)) {
|
||||
|
||||
/* empty image */
|
||||
isoburn_set_start_byte(o, o->zero_nwa * 2048, 0);
|
||||
if(!(flag & 1))
|
||||
o->fabricated_disc_status= BURN_DISC_BLANK;
|
||||
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);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Alters and writes the first 64 kB of a "medium" to invalidate
|
||||
/** Alters and writes the first 64 kB of a "media" to invalidate
|
||||
an ISO image. (It shall stay restorable by skilled humans, though).
|
||||
The result shall especially keep libisoburn from accepting the medium
|
||||
The result shall especially keep libisoburn from accepting the media
|
||||
image as ISO filesystem.
|
||||
@param o A fully activated isoburn object. isoburn_start_emulation()
|
||||
was already called.
|
||||
@ -872,32 +510,11 @@ ex:;
|
||||
*/
|
||||
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
|
||||
*/
|
||||
memcpy(head + 16 * 2048 + 1, "CDXX1", 5);
|
||||
|
||||
/* Invalidate further ECMA-119 volume descriptors and possible UDF volume
|
||||
recognition sequence */
|
||||
for(i= 17 * 2048; i < 32 * 2048; i+= 2048) {
|
||||
if(end_ed_found) {
|
||||
if(head[i] == 0 && strncmp(head + i + 1, "BEA01", 5) == 0)
|
||||
memcpy(head + i + 1, "BEAX1", 5);
|
||||
else if(head[i] == 0 && strncmp(head + i + 1, "NSR", 3) == 0)
|
||||
memcpy(head + i + 1, "NSRX", 4);
|
||||
else if(head[i] == 0 && strncmp(head + i + 1, "TEA", 3) == 0)
|
||||
memcpy(head + i + 1, "TEAX", 4);
|
||||
} else if(strncmp(head + i + 1, "CD001", 5) == 0) {
|
||||
if(((unsigned char *) head)[i] == 0xff)
|
||||
end_ed_found= 1;
|
||||
memcpy(head + i + 3, "XX", 2);
|
||||
}
|
||||
}
|
||||
|
||||
strncpy((char*)o->target_iso_head + 16 * 2048 + 1, "CDXX1", 5);
|
||||
return isoburn_activate_session(o->drive);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,13 @@
|
||||
LIBISOBURN1 {
|
||||
global:
|
||||
isoburn_activate_session;
|
||||
isoburn_assess_written_features;
|
||||
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;
|
||||
@ -22,78 +18,41 @@ 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_iso_mbr_part_type;
|
||||
isoburn_igopt_get_iso_type_guid;
|
||||
isoburn_igopt_get_level;
|
||||
isoburn_igopt_get_max_ce_entries;
|
||||
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_part_type_guid;
|
||||
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_iso_mbr_part_type;
|
||||
isoburn_igopt_set_iso_type_guid;
|
||||
isoburn_igopt_set_level;
|
||||
isoburn_igopt_set_max_ce_entries;
|
||||
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_part_type_guid;
|
||||
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;
|
||||
@ -107,31 +66,22 @@ 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_tree_loaded;
|
||||
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;
|
||||
@ -141,21 +91,15 @@ 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_patch_level_text;
|
||||
Xorriso_get_problem_status;
|
||||
Xorriso_interpreter;
|
||||
Xorriso__is_compatible;
|
||||
Xorriso_lst_destroy_all;
|
||||
Xorriso_lst_get_next;
|
||||
Xorriso_lst_get_prev;
|
||||
@ -172,10 +116,8 @@ 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_assess_indev_features;
|
||||
Xorriso_option_auto_charset;
|
||||
Xorriso_option_backslash_codes;
|
||||
Xorriso_option_ban_stdio_write;
|
||||
@ -185,7 +127,6 @@ 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;
|
||||
@ -193,42 +134,31 @@ 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_access;
|
||||
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_boot_images;
|
||||
Xorriso_option_extract_cut;
|
||||
Xorriso_option_file_name_limit;
|
||||
Xorriso_option_file_size_limit;
|
||||
Xorriso_option_find;
|
||||
Xorriso_option_follow;
|
||||
@ -238,22 +168,14 @@ 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_nowtime;
|
||||
Xorriso_option_iso_rr_pattern;
|
||||
Xorriso_option_jigdo;
|
||||
Xorriso_option_joliet;
|
||||
Xorriso_option_joliet_map;
|
||||
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;
|
||||
@ -263,13 +185,9 @@ 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_named_pipe_loop;
|
||||
Xorriso_option_no_rc;
|
||||
Xorriso_option_not_leaf;
|
||||
Xorriso_option_not_list;
|
||||
@ -295,30 +213,21 @@ 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_set_filter;
|
||||
Xorriso_option_setfacl_listi;
|
||||
Xorriso_option_setfacli;
|
||||
Xorriso_option_setfattr_listi;
|
||||
Xorriso_option_setfacl_listi;
|
||||
Xorriso_option_setfattri;
|
||||
Xorriso_option_sh_style_result;
|
||||
Xorriso_option_signal_handling;
|
||||
Xorriso_option_sleep;
|
||||
Xorriso_option_setfattr_listi;
|
||||
Xorriso_option_set_filter;
|
||||
Xorriso_option_speed;
|
||||
Xorriso_option_split_size;
|
||||
Xorriso_option_status;
|
||||
@ -329,22 +238,18 @@ 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__preset_signal_behavior;
|
||||
Xorriso_process_errfile;
|
||||
Xorriso_process_msg_queues;
|
||||
Xorriso_program_arg_bsl;
|
||||
@ -352,14 +257,8 @@ 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;
|
||||
Xorriso__version;
|
||||
local: *;
|
||||
};
|
||||
|
||||
|
@ -1,27 +0,0 @@
|
||||
------------------------------------------------------------------------------
|
||||
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
|
300
releng/README
300
releng/README
@ -1,300 +0,0 @@
|
||||
------------------------------------------------------------------------------
|
||||
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
|
||||
Copyright (C) 2011, 2012, 2019 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 explicitly 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
|
||||
media: CD-RW, DVD-RW, DVD-RAM, DVD+RW, BD-RE.
|
||||
Other media types get refused, unless option --any_media is given.
|
||||
Data, which are possibly present on the media, get overwritten.
|
||||
The result gets check read and compared with the state of the input
|
||||
directory. MD5 mismatch causes a test failure. Differences to the directory
|
||||
state are reported but still regarded as success.
|
||||
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_isojigdo -x ../xorriso/xorriso [-- [--md5 | --sha256]]
|
||||
Exercises the production of a bootable Debian GNU/Linux image and its Jigdo
|
||||
files. This test downloads a Debian daily image for i386 of about 350 MB,
|
||||
extracts its content and composes a new image. Thus it needs about 1100 MB
|
||||
of disk space in releng/releng_generated_data when unpacked. Adding the daily
|
||||
image size itself, the total space used would peak at about 1.5 GB.
|
||||
This test will only work with GNU xorriso or if libjte was installed already
|
||||
when libisofs was built. Further it needs the program jigit-mkimage. Both
|
||||
are part of package jigit, version >= 1.22, available at:
|
||||
http://www.einval.com/~steve/software/JTE/
|
||||
Currently jigit builds only in GNU environments.
|
||||
debian-cd currently uses the --md5 format. In future it will use --sha256.
|
||||
|
||||
|
||||
Any auto_* script can be run on its own. Some of them demand option -x.
|
||||
All general options are accepted.
|
||||
|
||||
./auto_cxx
|
||||
Not included in GNU xorriso.
|
||||
Exercises inclusion of xorriso/xorriso.h and libisoburn/libisoburn.h
|
||||
in C++ programs and linking of the libraries. It is possible to override the
|
||||
use of g++ as compiler by shell variable CC. It might be necessary to set
|
||||
compiler options by shell variable CFLAGS before running the test.
|
||||
It might be necessary to hand over the install directory of libburn and
|
||||
libisofs in shell variable LD_LIBRARY_PATH.
|
||||
E.g. if on FreeBSD the include headers libisofs.h , libburn.h are not found:
|
||||
export CFLAGS="-I/usr/local/include"
|
||||
E.g. on GNU/Hurd, where libburn and libisofs are not found by the linker:
|
||||
export LD_LIBRARY_PATH="/usr/local/lib"
|
||||
|
||||
./auto_isocontent -x ../xorriso/xorriso
|
||||
Tests whether xorriso is able to record and restore two families of
|
||||
hard links.
|
||||
|
||||
./auto_printsize -x ../xorriso/xorriso
|
||||
Tests how long xorriso needs to compose a medium sized directory tree.
|
||||
If programs mkisofs and/or genisomage are available, then the same test
|
||||
is done with them.
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
What to do with FAIL results
|
||||
|
||||
The text output of the automatic tests is recorded in file
|
||||
releng_generated_data/log.run_all_auto
|
||||
|
||||
Script ./run_all_auto will detect failure of particular tests and report
|
||||
lines from the log file which contain problem indicating keywords:
|
||||
NEVER,ABORT,FATAL,FAILURE,MISHAP,SORRY,WARNING,HINT,FAIL,ERROR,WRONG
|
||||
|
||||
If the program messages in log.run_all_auto do not explain the failure,
|
||||
please contact mailing list libburn-hackers@pykix.org .
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Alternative Shells
|
||||
|
||||
If you decided against installing /bin/bash, you may try to use your
|
||||
current $SHELL by running
|
||||
./change_shell_to_use
|
||||
which will modify the test scripts named run_all_auto , auto_* ,manual_*.
|
||||
|
||||
Known to be suitable are the following shells
|
||||
GNU/Linux: /bin/bash
|
||||
FreeBSD 8: /bin/sh
|
||||
Solaris: /bin/bash , /bin/i86/ksh93
|
||||
In general, the shell should have Bourne shell ancestry.
|
||||
|
||||
The script does not choose an interpreter explicitly and is safe to be run
|
||||
inline:
|
||||
. ./change_shell_to_use
|
||||
One may set any interpreter path by running a sub shell and changing its
|
||||
variable SHELL. E.g. by:
|
||||
( SHELL=/bin/my_shell" ; . ./change_shell_to_use )
|
||||
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Creating a new test script
|
||||
|
||||
If you want to provide an own test, manual or auto, then first invent a name
|
||||
for it
|
||||
test_name="releng/manual_"...some.name...
|
||||
or
|
||||
test_name="releng/auto_"...some.name...
|
||||
Then copy file releng/template_new to $test_name.
|
||||
Edit $test_name and process any line that begins by "# === TEMPLATE:".
|
||||
Do what the line prescribes and then remove it from the script. You are
|
||||
not done as long as such a line remains.
|
||||
|
||||
Your test must not start if no file
|
||||
./inc/releng_getopts.inc
|
||||
exists, i.e. if the current working directory is not ./releng.
|
||||
If your test creates own files on disk, then it must do this underneath
|
||||
directory
|
||||
./releng_generated_data/$test_name (or $GEN_DATA_DIR, see below).
|
||||
|
||||
In case of failure, issue a line to stdout that begins by the word "FAIL",
|
||||
followed by " : " and the name of the test (e.g. $SELF, see below).
|
||||
Make sure that the test script finally returns a non-zero exit value.
|
||||
This value should be between 1 and 28. Each type of failure should have its
|
||||
own exit value.
|
||||
Predefined are:
|
||||
31 = Unknown option or unusable argument with known option
|
||||
30 = Unexpected state of own directory for self generated files
|
||||
29 = Not in ./releng directory or missing essential parts of ./releng
|
||||
|
||||
When exiting prematurely, make sure to call function cleanup.
|
||||
|
||||
|
||||
Variables, general options, helper functions
|
||||
|
||||
The master script run_all_auto sets this variable:
|
||||
|
||||
RELENG_SCRIPT_RUN_BY_RUN_ALL_AUTO
|
||||
1=supervised, the script is run by run_all_auto script
|
||||
else=standalone, the script is run in standalone mode
|
||||
|
||||
The code piece inc/releng_getopts.inc should get executed inline at the
|
||||
start of a test script. It initializes the following variables and sets
|
||||
some of them according to the general options of the test suite:
|
||||
|
||||
SELF basename $0
|
||||
|
||||
GEN_DATA_DIR releng_generated_data/${SELF}
|
||||
|
||||
RELENG_XORRISO Path to xorriso binary. "" or "0" means no xorriso.
|
||||
Default "0". Adjustable by option -x.
|
||||
|
||||
SIMULATE_FAILURE 0=normal operation, 1=test script shall simulate a failure.
|
||||
Default 0. Setable to 1 by option -f.
|
||||
|
||||
CLEANUP 0=do not cleanup temporary data, 1=normal operation
|
||||
Default 1. Setable to 0 by option -k.
|
||||
|
||||
SPECIFIC_HELP 0=normal operation, 1=print help text of script and exit 0
|
||||
Default 0. Setable to 1 by option -h.
|
||||
|
||||
The code piece inc/releng_getopts.inc defines the following functions
|
||||
for use by the single tests:
|
||||
|
||||
standalone_or_supervised This is internally called routine to print out
|
||||
the running mode of the scripts - standalone,
|
||||
supervised by run_all_auto.
|
||||
No need to call it from the scripts themselves.
|
||||
|
||||
print_help Prints the help text for general options.
|
||||
|
||||
check_for_xorriso [-x]
|
||||
Will exit with value 31 if no path to a xorriso binary
|
||||
was defined by option -x of ./run_all_auto or a single
|
||||
test.
|
||||
Option -x of check_for_xorriso additionally tests whether
|
||||
the given path leads to an executable program.
|
||||
|
||||
cleanup Removes the directory tree GEN_DATA_DIR after making
|
||||
some safety checks.
|
||||
|
||||
boldify Try to set the terminal mode for future output to a more
|
||||
noticeable style of writing.
|
||||
unboldify Reset terminal mode to normal style of writing.
|
||||
|
||||
|
||||
Specific options
|
||||
|
||||
Options which are specific to the test should begin with a double dash.
|
||||
They may have further arguments.
|
||||
Implement them in the prepared interpreter loop which begins after line
|
||||
next_is=ignore
|
||||
|
||||
Specific options shall only be interpreted by tests which get run manually.
|
||||
If you plan to introduce a specific option, look at the description of
|
||||
existing tests whether one of them would match your needs. In that case,
|
||||
please re-use the name of that existing option.
|
||||
|
42
releng/TODO
42
releng/TODO
@ -1,42 +0,0 @@
|
||||
|
||||
* Manpage examples turned into tests
|
||||
Convert most examples from xorriso(1) manpage into tests.
|
||||
|
||||
* Enhance 'auto_isocontent'
|
||||
Extend it to use some more demanding directory tree.
|
||||
MD5s should be checked.
|
||||
All file types as of stat(2) should be tested.
|
||||
Test various comparisons:
|
||||
xorriso provides built-in means for comparison:
|
||||
xorriso -compare_r disk_path iso_rr_path
|
||||
xorriso -indev my.iso -find / vs. find input_dir
|
||||
bsdtar -xf my.iso vs. input_dir
|
||||
|
||||
* Test for wrong CD sizes would need a new test and probably an
|
||||
automatic CD changer.
|
||||
|
||||
* Library unit tests - investigate the possibility to write some
|
||||
cunit-based tests (http://cunit.sourceforge.net) for both
|
||||
xorriso.h and libisoburn.h API's. The code samples could be put into
|
||||
codesamples/ directory and run by auto_cxx or a separate auto_ script.
|
||||
|
||||
* ??? Still to decide:
|
||||
Delete debian-testing-i386-businesscard.iso with ./run_all_auto -c
|
||||
Contra: Currently remaining large files (like downloaded ISO images) are
|
||||
simply left behind to be re-used and a boldified info message is shown
|
||||
so the users can decide for themselves what to remove or leave as well.
|
||||
Pro: Leaving 70 MB of image is quite obtrusive. Option -c is not run
|
||||
under normal circumstances. So it could well be used for total cleanup.
|
||||
Alternative: Specific option --remove_image.
|
||||
|
||||
* ??? Still to decide:
|
||||
Have a script ./run_all_manual
|
||||
Contra argument: if a releng sctipt is suitable to be run under a master
|
||||
script run_all*, then this releng script should be put into auto_*
|
||||
namespace , otherwise it is manual_*.
|
||||
Pro: Tests may be manual because they demand lots of resources, not
|
||||
because they need manual attention. In general the run_all_manual script
|
||||
shall spare the user the plight to read the documentation. Instead it
|
||||
shall present the manual tests, give an opportunity to skip the test,
|
||||
and ask for parameters,
|
||||
|
@ -1,88 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
set -e
|
||||
|
||||
not_in_releng_exit() {
|
||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
. inc/releng_getopts.inc || not_in_releng_exit
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
none yet.
|
||||
Overview:
|
||||
Tests both xorriso/xorriso.h and libisoburn/libisoburn.h
|
||||
APIs for C++ cleanness.
|
||||
HLP
|
||||
}
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1; then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# xorriso binary is not needed for that particular test
|
||||
SAMPLE_CODE_DIR=codesamples
|
||||
CC=${CC:-g++}
|
||||
|
||||
# check compiler
|
||||
if ! which "${CC}" >/dev/null 2>&1; then
|
||||
printf "\n${SELF}: Not found: ${CC}. Install ${CC}.\n"
|
||||
cleanup
|
||||
exit 5
|
||||
fi
|
||||
|
||||
# check data dir
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
|
||||
exit 6
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
INCLUDE_DIRS="-I../ -I../../libburn -I../../libisofs -I/usr/local/include -I/usr/pkg/include"
|
||||
|
||||
# process sample code tests
|
||||
for SMPL in `ls "${SAMPLE_CODE_DIR}"/*.cpp`; do
|
||||
# CMD_CPL="${CC} -I../ -L ../libisoburn/.libs/ ${CFLAGS} -lisoburn -o ${SMPL}.obj ${SMPL}"
|
||||
CMD_CPL="${CC} -c ${INCLUDE_DIRS} ${CFLAGS} -o ${SMPL}.obj ${SMPL}"
|
||||
printf "${SELF}: ${CMD_CPL}"
|
||||
set +e
|
||||
${CMD_CPL}
|
||||
RET_CPL="$?"
|
||||
if [ ${RET_CPL} = 0 -a -f ${SMPL}.obj ]; then
|
||||
mv ${SMPL}.obj ${GEN_DATA_DIR}
|
||||
printf "...ok\n"
|
||||
else
|
||||
printf "\nFAIL : ${SELF}: Compilation of ${SMPL}\n"
|
||||
cleanup
|
||||
exit 7
|
||||
fi
|
||||
# BASE=$(basename ${SMPL}.obj)
|
||||
# printf "${SELF}: Running LD_LIBRARY_PATH=../libisoburn/.libs/:${LD_LIBRARY_PATH} ${GEN_DATA_DIR}/${BASE}"
|
||||
# LD_LIBRARY_PATH=../libisoburn/.libs/:${LD_LIBRARY_PATH} ${GEN_DATA_DIR}/${BASE}
|
||||
# RET_SMPL="$?"
|
||||
# case ${RET_SMPL} in
|
||||
# 0)
|
||||
# printf "...ok\n"
|
||||
# ;;
|
||||
# *)
|
||||
# printf "exit code: ${RET_SMPL}\n"
|
||||
# cleanup
|
||||
# exit 8
|
||||
# ;;
|
||||
# esac
|
||||
set -e
|
||||
done
|
||||
|
||||
# clean
|
||||
cleanup
|
||||
|
||||
exit 0
|
@ -1,400 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
# Test the correct handling of hardlinks by xorriso options
|
||||
# -update_r , -hardlinks perform_update , and -extract
|
||||
# If there is support for ACLs or xattr in xorriso and on the local system,
|
||||
# then test recording and restoring of these features.
|
||||
|
||||
not_in_releng_exit() {
|
||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
. inc/releng_getopts.inc || not_in_releng_exit
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
none yet.
|
||||
Overview:
|
||||
Tests ISO image contents by performing various
|
||||
image generation, extractions and comparisons.
|
||||
HLP
|
||||
}
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1; then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -x $RELENG_XORRISO ]; then
|
||||
print_help
|
||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||
exit 31
|
||||
fi
|
||||
|
||||
# check data dir, if any and after checking -x xorriso
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
|
||||
exit 8
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
export xorriso=${RELENG_XORRISO}
|
||||
export workdir=${GEN_DATA_DIR}
|
||||
export image_file="$workdir"/xorriso_hardlinks.iso
|
||||
export on_disk="$workdir"/xorriso_hardlinks_test_dir
|
||||
export in_iso=""
|
||||
export copy_on_disk="$workdir"/xorriso_hardlinks_copy_dir
|
||||
export failure=0
|
||||
export simulate_failure=${SIMULATE_FAILURE}
|
||||
export next_is_xorriso=0
|
||||
export next_is_rc=0
|
||||
export bad=0
|
||||
export report_about="-report_about UPDATE"
|
||||
|
||||
test -z "$in_iso" && in_iso="$on_disk"
|
||||
|
||||
# mkdir "$workdir" || bad=1
|
||||
mkdir "$on_disk" || bad=1
|
||||
if test "$bad" = 1
|
||||
then
|
||||
echo -e "\nFAIL : ${SELF} : Test environment error : Cannot make directories"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
|
||||
# All must be set at this point
|
||||
printf "\n${SELF}: Setting up $on_disk with several hardlinks\n" >&2
|
||||
echo test_content >"$on_disk"/file_1 || exit 1
|
||||
echo test_content >"$on_disk"/file_2 || exit 1
|
||||
ln "$on_disk"/file_1 "$on_disk"/file_1_link_a || exit 1
|
||||
ln "$on_disk"/file_1 "$on_disk"/file_1_link_b || exit 1
|
||||
ln "$on_disk"/file_2 "$on_disk"/file_2_link_a || exit 1
|
||||
|
||||
# trivial ISO 9660 image validation routine
|
||||
is_valid_iso9660() {
|
||||
ISOfile="$1"
|
||||
if ! which file >/dev/null 2>&1; then
|
||||
printf "\nFAIL : ${SELF}: Not found: file. Please install the file(1) utility.\n"
|
||||
failure=1
|
||||
return
|
||||
fi
|
||||
if [ ! -f ${ISOfile} ]; then
|
||||
failure=1
|
||||
printf "\nFAIL : ${SELF} : Not found: ${ISOfile}\n"
|
||||
return
|
||||
fi
|
||||
|
||||
file ${ISOfile}
|
||||
if file ${ISOfile} | grep "ISO *9660" >/dev/null 2>&1; then
|
||||
printf "\n${SELF}: Resulting ${ISOfile} OK. Looks like ISO 9660 filesystem.\n"
|
||||
else
|
||||
failure=1
|
||||
printf "\nFAIL : ${SELF} : ${ISOfile} DOES NOT look like ISO 9660 filesystem data.\n"
|
||||
fi
|
||||
}
|
||||
|
||||
# Retrieve and evaluate return value of command run under return_wrapper
|
||||
check_xorriso_return() {
|
||||
ret=$(cat "$return_value_file")
|
||||
rm "$return_value_file"
|
||||
if test "$ret" = 0
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
failure=1
|
||||
echo
|
||||
echo "FAIL : ${SELF} : xorriso run exited with value $ret"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Create test file and find out whether ACLs and/or xattr are available.
|
||||
#
|
||||
# Users known on GNU/Linux and FreeBSD: root games daemon man
|
||||
# Groups : daemon games bin sshd sys
|
||||
# On both systems, ACLs are manipulated by setfacl/getfacl
|
||||
#
|
||||
acl_xattr_test_file="$on_disk"/acl_xattr_test_file
|
||||
acl_xattr_copy_file="$copy_on_disk"/acl_xattr_test_file
|
||||
acl_xattr_test_dir="$on_disk"/acl_xattr_test_dir
|
||||
acl_xattr_iso_dir="$in_iso"/acl_xattr_test_dir
|
||||
acl_xattr_copy_dir="$copy_on_disk"/acl_xattr_test_dir
|
||||
mkdir "$acl_xattr_test_dir"
|
||||
echo echo hello world >"$acl_xattr_test_file" || exit 1
|
||||
sys=$(uname -s)
|
||||
acls=no
|
||||
default_acls=no
|
||||
setfacl_opts=""
|
||||
if ( setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g:sys:rwx,u:daemon:r--,mask::rwx \
|
||||
"$acl_xattr_test_file" ) >/dev/null 2>&1
|
||||
then
|
||||
if ( getfacl "$acl_xattr_test_file" ) >/dev/null 2>&1
|
||||
then
|
||||
if ( setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g:sys:rwx,u:daemon:r--,mask::rwx \
|
||||
"$acl_xattr_test_dir" ) >/dev/null 2>&1
|
||||
then
|
||||
acls=yes
|
||||
# Setting of "default" ACLs will fail on FreeBSD. It will nevertheless be
|
||||
# done in the image by a xorriso command. Restoring is supposed to skip
|
||||
# "default" ACLs if none could be recorded.
|
||||
if setfacl -m u::rwx,g::r-x,o::---,u:root:rwx,g:sys:rwx,u:daemon:r--,mask::rwx,d:u::rwx,d:g::r-x,d:o::---,d:u:root:rwx,d:g:sys:rwx,d:u:daemon:r--,d:mask::rwx "$acl_xattr_iso_dir" 2>/dev/null
|
||||
then
|
||||
default_acls=yes
|
||||
fi
|
||||
setfacl_opts="-setfacl u::rwx,g::r-x,o::---,u:root:rwx,g:sys:rwx,u:daemon:r--,mask::rwx,d:u::rwx,d:g::r-x,d:o::---,d:u:root:rwx,d:g:sys:rwx,d:u:daemon:r--,d:mask::rwx $acl_xattr_iso_dir --"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# GNU/Linux and FreeBSD have different tools for Extended Attributes
|
||||
xattrs=no
|
||||
extattrs=no
|
||||
# Try GNU/Linux style setattr/getattr
|
||||
if ( setfattr -n user.test_xattr -v test_value "$acl_xattr_test_file" ) \
|
||||
>/dev/null 2>&1
|
||||
then
|
||||
if ( getfattr -d "$acl_xattr_test_file" ) >/dev/null 2>&1
|
||||
then
|
||||
xattrs=yes
|
||||
setfattr -n user.long_data -v 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
|
||||
setfattr -n user.more_data -v 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
|
||||
fi
|
||||
fi
|
||||
if test "$xattrs" = no
|
||||
then
|
||||
# Try FreeBSD style setextattr
|
||||
if ( setextattr user test_xattr test_value "$acl_xattr_test_file" ) \
|
||||
>/dev/null 2>&1
|
||||
then
|
||||
if ( getextattr user test_xattr "$acl_xattr_test_file" ) >/dev/null 2>&1
|
||||
then
|
||||
setextattr user long_data 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
|
||||
setextattr user more_data 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 "$acl_xattr_test_file"
|
||||
if ( lsextattr user "$acl_xattr_test_file" ) >/dev/null 2>&1
|
||||
then
|
||||
extattrs=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "${SELF}: Detected sys='$sys' , acls=$acls , d_acls=$default_acls , xattrs=$xattrs , extattrs=$extattrs"
|
||||
|
||||
# Examine capabilities of xorriso
|
||||
xorriso_acls=no
|
||||
xorriso_xattrs=no
|
||||
extras=$("$xorriso" -list_extras all 2>/dev/null)
|
||||
if test "$?" = 0
|
||||
then
|
||||
if echo "$extras" | fgrep 'Local ACL : yes' >/dev/null 2>&1
|
||||
then
|
||||
xorriso_acls=yes
|
||||
fi
|
||||
if echo "$extras" | fgrep 'Local xattr : yes' >/dev/null 2>&1
|
||||
then
|
||||
xorriso_xattrs=yes
|
||||
fi
|
||||
fi
|
||||
if test "$xorriso_acls" = no
|
||||
then
|
||||
acls=no
|
||||
setfacl_opts=
|
||||
fi
|
||||
if test "$xorriso_xattrs" = no
|
||||
then
|
||||
xattrs=no
|
||||
extattrs=no
|
||||
fi
|
||||
|
||||
echo "${SELF}: Detected xorriso_acls=$xorriso_acls , xorriso_xattrs=$xorriso_xattrs"
|
||||
echo
|
||||
ls -l "$on_disk"/*
|
||||
|
||||
echo -e "\n${SELF}: Producing simple image via -o" >&2
|
||||
"$xorriso" -as mkisofs "$on_disk" -o "$workdir"/image_minus_o.iso
|
||||
is_valid_iso9660 "$workdir"/image_minus_o.iso
|
||||
|
||||
echo -e "\n${SELF}: Producing simple image via redirect" >&2
|
||||
"$xorriso" -as mkisofs "$on_disk" > "$workdir"/image_redirected.iso
|
||||
is_valid_iso9660 "$workdir"/image_redirected.iso
|
||||
|
||||
echo -e "\n${SELF}: Producing simple image via pipe" >&2
|
||||
return_wrapper "$xorriso" -as mkisofs "$on_disk" | \
|
||||
cat > "$workdir"/image_piped.iso
|
||||
check_xorriso_return
|
||||
is_valid_iso9660 "$workdir"/image_piped.iso
|
||||
|
||||
echo -e "\n${SELF}: Producing simple image with for_backup/update_r/hardlinks" >&2
|
||||
"$xorriso" \
|
||||
$report_about \
|
||||
-version \
|
||||
-for_backup \
|
||||
-padding 0 \
|
||||
-outdev "$image_file" \
|
||||
-volid TEST_AUTO_ISOCONTENT \
|
||||
-update_r "$on_disk" "$in_iso" \
|
||||
$setfacl_opts \
|
||||
-hardlinks perform_update
|
||||
ret=$?
|
||||
|
||||
if test "$ret" -gt 0 -a "$ret" -lt 32
|
||||
then
|
||||
printf "\nFAIL : ${SELF} : xorriso write run failed\n\n"
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
is_valid_iso9660 "$image_file"
|
||||
|
||||
|
||||
# It must refuse to load and go on with -assert_volid and non-matching pattern.
|
||||
msg=$(\
|
||||
"$xorriso" \
|
||||
-abort_on FATAL \
|
||||
-return_with FAILURE 32 \
|
||||
-assert_volid 'NON_MATCHING*' FATAL \
|
||||
-indev "$image_file" \
|
||||
2>&1
|
||||
)
|
||||
ret=$?
|
||||
if test "$ret" -gt 0 -a "$ret" -lt 32
|
||||
then
|
||||
printf "\n${SELF}: Ok. -assert_volid snapped.\n"
|
||||
elif test "$ret" -ne 0
|
||||
then
|
||||
failure=1
|
||||
echo >&2
|
||||
echo "$msg" >&2
|
||||
printf "\nFAIL : ${SELF} : -assert_volid test not properly performed\n\n"
|
||||
else
|
||||
failure=1
|
||||
printf "\nFAIL : ${SELF} : -assert_volid did not snap\n\n" >&2
|
||||
fi
|
||||
|
||||
echo -e "\n${SELF}: Copying from image to temporary disk tree" >&2
|
||||
"$xorriso" \
|
||||
$report_about \
|
||||
-for_backup \
|
||||
-assert_volid 'TEST_AUTO_ISOCONT*' FATAL \
|
||||
-indev "$image_file" \
|
||||
-osirrox on \
|
||||
-find "$in_iso" -exec lsdl -- \
|
||||
-extract "$in_iso" "$copy_on_disk"
|
||||
ret=$?
|
||||
if test "$ret" -gt 0 -a "$ret" -lt 32
|
||||
then
|
||||
printf "\nFAIL : ${SELF} : xorriso file extraction run failed\n\n"
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "$simulate_failure" = 1
|
||||
then
|
||||
echo -e "\n${SELF}: SIMULATING FAILURE BY REMOVING AN EXTRACTED FILE" >&2
|
||||
echo -e "\nFAIL : ${SELF} : Simulated failure caused by option -fail"
|
||||
rm "$copy_on_disk"/file_1_link_b
|
||||
fi
|
||||
|
||||
|
||||
printf "\n${SELF}: Comparing original disk tree and temporary one..." >&2
|
||||
diff -r "$on_disk" "$copy_on_disk"
|
||||
if test "$?" -ne 0
|
||||
then
|
||||
echo -e "\nFAIL : ${SELF} : diff -r $on_disk $copy_on_disk reports differences" >&2
|
||||
echo -e "\nFAIL : ${SELF} : diff -r reports differences"
|
||||
failure=1
|
||||
else
|
||||
printf "OK" >&2
|
||||
fi
|
||||
|
||||
printf "\n${SELF}: Checking for hardlinks being siblings...\n"
|
||||
ls -l "$copy_on_disk"/*
|
||||
x=$(echo $(ls -ld "$copy_on_disk"/*file* | awk '{print $2}'))
|
||||
expected="1 3 3 3 2 2"
|
||||
if test x"$x" = x"$expected"
|
||||
then
|
||||
printf "${SELF}: Checking for hardlinks being siblings done: ok.\n" >&2
|
||||
else
|
||||
printf "\nFAIL : ${SELF} : Link count of extracted files is not as expected." >&2
|
||||
printf "\n${SELF}: Expected: $expected" >&2
|
||||
printf "\n${SELF}: Got : $x\n" >&2
|
||||
failure=1
|
||||
fi
|
||||
|
||||
if test "$acls" = yes
|
||||
then
|
||||
printf "\n${SELF}: Checking ACLs ...\n" >&2
|
||||
acl_on_disk=$(getfacl "$acl_xattr_test_file" | grep -v '^# file:' | sort)
|
||||
acl_in_copy=$(getfacl "$acl_xattr_copy_file" | grep -v '^# file:' | sort)
|
||||
if test "$acl_on_disk" = "$acl_in_copy"
|
||||
then
|
||||
printf "${SELF}: Checking ACLs done: ok.\n" >&2
|
||||
else
|
||||
printf "\nFAIL : ${SELF} : ACL mismatch between original and extracted copy\n"
|
||||
printf "\nOriginal:\n${acl_on_disk}\n"
|
||||
printf "\nCopy:\n${acl_in_copy}\n"
|
||||
failure=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$xattrs" = yes
|
||||
then
|
||||
printf "\n${SELF}: Checking xattr via getfattr ...\n" >&2
|
||||
xattr_on_disk=$(getfattr "$acl_xattr_test_file" | \
|
||||
grep -v '^# file:' | grep -v '^$' | \sort)
|
||||
xattr_in_copy=$(getfattr "$acl_xattr_copy_file" |
|
||||
grep -v '^# file:' | grep -v '^$' | sort)
|
||||
if test "$xattr_on_disk" = "$xattr_in_copy"
|
||||
then
|
||||
num_xattr=$(echo "$xattr_on_disk" | wc -l)
|
||||
printf "${SELF}: Checking xattr done: $num_xattr attributes, ok.\n" >&2
|
||||
else
|
||||
printf "\nFAIL : ${SELF} : xattr mismatch between original and extracted copy\n"
|
||||
printf "\nOriginal:\n${xattr_on_disk}\n"
|
||||
printf "\nCopy:\n${xattr_in_copy}\n"
|
||||
failure=1
|
||||
fi
|
||||
elif test "$extattrs" = yes
|
||||
then
|
||||
printf "\n${SELF}: Checking xattr via lsextattr and getextattr ...\n" >&2
|
||||
lsext_on_disk=$(lsextattr -q user "$acl_xattr_test_file")
|
||||
xattr_on_disk=$(for i in $lsext_on_disk ; do echo $i $(getextattr -q user $i "$acl_xattr_test_file"); done | sort)
|
||||
lsext_in_copy=$(lsextattr -q user "$acl_xattr_copy_file")
|
||||
xattr_in_copy=$(for i in $lsext_in_copy ; do echo $i $(getextattr -q user $i "$acl_xattr_copy_file"); done | sort)
|
||||
if test "$xattr_on_disk" = "$xattr_in_copy"
|
||||
then
|
||||
num_xattr=$(echo "$xattr_on_disk" | wc -l)
|
||||
printf "${SELF}: Checking xattr done: $num_xattr attributes, ok.\n" >&2
|
||||
else
|
||||
printf "\nFAIL : ${SELF} : xattr mismatch between original and extracted copy\n"
|
||||
printf "\nOriginal:\n${xattr_on_disk}\n"
|
||||
printf "\nCopy:\n${xattr_in_copy}\n"
|
||||
failure=1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
echo
|
||||
cleanup
|
||||
|
||||
# Report result
|
||||
echo
|
||||
if test "$failure" = 1
|
||||
then
|
||||
printf "${SELF}: FAILED"
|
||||
echo
|
||||
exit 1
|
||||
else
|
||||
printf "${SELF}: Passed"
|
||||
echo
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,149 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
set -e
|
||||
|
||||
not_in_releng_exit() {
|
||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Include common bits
|
||||
. inc/releng_getopts.inc || not_in_releng_exit
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
none yet.
|
||||
Overview:
|
||||
Test performance of print_size against various input tree.
|
||||
Optionally compare with genisoimage and mkisofs.
|
||||
HLP
|
||||
}
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1; then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Each test should decide whether or not it needs
|
||||
# a xorriso binary to test, since some do compilations only.
|
||||
if [ ! -x $RELENG_XORRISO ]; then
|
||||
print_help
|
||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||
exit 31
|
||||
fi
|
||||
|
||||
# check data dir, if any and after checking -x xorriso
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
|
||||
exit 8
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
#
|
||||
DIR_UPPER=32
|
||||
FILE_UPPER=10
|
||||
|
||||
# All must be set at this point
|
||||
# TODO: work out a smarter way to quickly generate different
|
||||
# types of trees (long, deep, etc)
|
||||
printf "\n${SELF}: Generating sample tree in ${GEN_DATA_DIR} :\n"
|
||||
count=0
|
||||
date
|
||||
|
||||
# Hopefully the for-loops are much faster than while-loops with arithmetics
|
||||
# This needs 7/4*DIR_UPPER+FILE_UPPER (= 66) while-iterations
|
||||
#
|
||||
i1_list=
|
||||
i1=0
|
||||
o1=$(expr ${DIR_UPPER} / 4)
|
||||
while test $i1 -lt $o1
|
||||
do
|
||||
i1_list="$i1_list $i1"
|
||||
i1=$(expr $i1 + 1)
|
||||
done
|
||||
i2_list=
|
||||
i2=0
|
||||
o2=$(expr ${DIR_UPPER} / 2)
|
||||
while test $i2 -lt $o2
|
||||
do
|
||||
i2_list="$i2_list $i2"
|
||||
i2=$(expr $i2 + 1)
|
||||
done
|
||||
i3_list=
|
||||
i3=0
|
||||
while test $i3 -lt ${DIR_UPPER}
|
||||
do
|
||||
i3_list="$i3_list $i3"
|
||||
i3=$(expr $i3 + 1)
|
||||
done
|
||||
i_file_list=
|
||||
i_file=0
|
||||
while test $i_file -lt ${FILE_UPPER}
|
||||
do
|
||||
i_file_list="$i_file_list $i_file"
|
||||
i_file=$(expr $i_file + 1)
|
||||
done
|
||||
#
|
||||
# plus 1/8*DIR_UPPER*DIR_UPPER*DIR_UPPER*FILE_UPPER (= 40960) for-iterations
|
||||
#
|
||||
for i1 in $i1_list
|
||||
do
|
||||
for i2 in $i2_list
|
||||
do
|
||||
for i3 in $i3_list
|
||||
do
|
||||
mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3
|
||||
for i_file in $i_file_list
|
||||
do
|
||||
echo -n \
|
||||
> ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/File_${i_file}
|
||||
count=$((count + 1))
|
||||
done
|
||||
done
|
||||
done
|
||||
echo " ${count} files created ..."
|
||||
done
|
||||
|
||||
printf "done.\n"
|
||||
date
|
||||
du -s "${GEN_DATA_DIR}"
|
||||
|
||||
printf "\n${SELF}: Performing several print size runs to neutralize possible disk cache impact.\n"
|
||||
|
||||
# run xorriso
|
||||
if [ -x ${RELENG_XORRISO} ]; then
|
||||
for run in 1 2 3; do
|
||||
printf "\n${SELF}: Running ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
|
||||
time ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}
|
||||
done
|
||||
fi
|
||||
|
||||
# try to run genisoimage
|
||||
if which genisoimage >/dev/null 2>&1; then
|
||||
RELENG_GENISOIMAGE=`which genisoimage`
|
||||
for run in 1 2 3; do
|
||||
printf "\n${SELF}: Running ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
|
||||
time ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}
|
||||
done
|
||||
fi
|
||||
|
||||
# try to run mkisofs
|
||||
if which mkisofs >/dev/null 2>&1; then
|
||||
RELENG_MKISOFS=`which mkisofs`
|
||||
for run in 1 2 3; do
|
||||
printf "\n${SELF}: Running ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
|
||||
time ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}
|
||||
done
|
||||
fi
|
||||
|
||||
#
|
||||
cleanup
|
||||
|
||||
#
|
||||
exit 0
|
@ -1,39 +0,0 @@
|
||||
|
||||
# check whether we are in releng and create dir
|
||||
mkdir_ret=29
|
||||
if test -d releng_generated_data
|
||||
then
|
||||
if test -d releng_generated_data/change_shell_to_use
|
||||
then
|
||||
mkdir_ret=0
|
||||
else
|
||||
mkdir releng_generated_data/change_shell_to_use
|
||||
mkdir_ret=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$mkdir_ret" = 0
|
||||
then
|
||||
for i in run_all_auto auto_* manual_*
|
||||
do
|
||||
temp=releng_generated_data/change_shell_to_use/temp_file
|
||||
c=$(wc -l "$i" | awk '{print $1}')
|
||||
line=$(head -n 1 "$i")
|
||||
|
||||
if echo x"$line" | grep '^x#!' >/dev/null 2>&1
|
||||
then
|
||||
cp "$i" "$temp"
|
||||
echo '#!'"$SHELL" > "$temp"
|
||||
tail -n "$(expr $c - 1)" "$i" >> "$temp"
|
||||
mv "$temp" "$i"
|
||||
echo "Changed to #!$SHELL : $i"
|
||||
fi
|
||||
done
|
||||
rmdir releng_generated_data/change_shell_to_use
|
||||
else
|
||||
echo "change_shell_to_use: Missing directory ./releng_generated_data" >&2
|
||||
echo "or cannot create directory ./releng_generated_data/change_shell_to_use" >&2
|
||||
echo "change_shell_to_use: Run aborted"
|
||||
test 1 = 0
|
||||
fi
|
||||
|
@ -1,34 +0,0 @@
|
||||
// Just to ensure we are C++-clean. This should not spit too much noise
|
||||
|
||||
/* Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
* Released into the public domain
|
||||
*/
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
#define _LARGEFILE_SOURCE 1
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <inttypes.h>
|
||||
|
||||
//extern "C" {
|
||||
#include "libburn/libburn.h"
|
||||
#include "libisofs/libisofs.h"
|
||||
// using namespace burn;
|
||||
// (this was needed to before rev.4062 of libisoburn)
|
||||
#include "libisoburn/libisoburn.h"
|
||||
//}
|
||||
|
||||
int main() {
|
||||
int major=-1, minor=-1, micro=-1;
|
||||
isoburn_version(&major, &minor, µ);
|
||||
if (major<0 || minor<0 || micro<0)
|
||||
return -1;
|
||||
std::cout
|
||||
<< " major:" << major
|
||||
<< " minor:" << minor
|
||||
<< " micro:" << micro
|
||||
;
|
||||
return 0;
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
// Just to ensure we are C++-clean. This should not spit too much noise
|
||||
|
||||
/* Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
* Released into the public domain
|
||||
*/
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
#define _LARGEFILE_SOURCE 1
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <inttypes.h>
|
||||
|
||||
//extern "C" {
|
||||
#include "xorriso/xorriso.h"
|
||||
//}
|
||||
|
||||
int main() {
|
||||
int major=-1, minor=-1, micro=-1;
|
||||
Xorriso__version(&major, &minor, µ);
|
||||
if (major<0 || minor<0 || micro<0)
|
||||
return -1;
|
||||
std::cout
|
||||
<< " major:" << major
|
||||
<< " minor:" << minor
|
||||
<< " micro:" << micro
|
||||
;
|
||||
return 0;
|
||||
}
|
@ -1,204 +0,0 @@
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
SELF=$(basename $0)
|
||||
RELENG_XORRISO=0
|
||||
SIMULATE_FAILURE=0
|
||||
CLEANUP=1
|
||||
SPECIFIC_HELP=0
|
||||
START_DIR_DONT_CHANGE=`pwd`
|
||||
GEN_DATA_DIR=releng_generated_data/${SELF}
|
||||
|
||||
#############################################
|
||||
standalone_or_supervised() {
|
||||
case "${RELENG_SCRIPT_RUN_BY_RUN_ALL_AUTO}" in
|
||||
1)
|
||||
echo "${SELF}: Running in Supervised mode"
|
||||
;;
|
||||
*)
|
||||
echo "${SELF}: Running in Standalone mode"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Unconditionally shout out the invocation mode - standalone or supervised
|
||||
standalone_or_supervised
|
||||
|
||||
#############################################
|
||||
print_help() {
|
||||
cat << EOF
|
||||
|
||||
Usage: $SELF -x path/to/xorriso [-k] [-f] [-c] [-h]
|
||||
[-- ...test specific options...]
|
||||
General options:
|
||||
-x absolute or relative path to xorriso binary to be run.
|
||||
-k keep self-generated data.
|
||||
-c cleanup self-generated data kept from previous run and exit.
|
||||
-f simulate failure.
|
||||
-h print this help text
|
||||
-- end of general options, begin of test specific options.
|
||||
EOF
|
||||
}
|
||||
|
||||
#############################################
|
||||
boldify() {
|
||||
if which tput >/dev/null 2>&1
|
||||
then
|
||||
tput smso || dummy_variable=1
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################
|
||||
unboldify() {
|
||||
if which tput >/dev/null 2>&1
|
||||
then
|
||||
tput rmso || dummy_variable=1
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################
|
||||
cleanup() {
|
||||
if [ ${CLEANUP} -eq 1 ]; then
|
||||
# safety net, just in case -> we want to be in the starting
|
||||
# directory before removing whatever self-generated stuff
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
cd "${START_DIR_DONT_CHANGE}" || exit 2
|
||||
|
||||
# Verify once again we are in the releng_generated_data directory
|
||||
# Check for both returned code of grep and returned matching string
|
||||
# There is no "readlink -e" on FreeBSD
|
||||
READ_CANON_EXISTS=`cd "${GEN_DATA_DIR}" 2>/dev/null && pwd`
|
||||
DIR_NAME_GEN_DATA=`dirname "${READ_CANON_EXISTS}"`
|
||||
set +e
|
||||
# There is no "grep -P" on FreeBSD
|
||||
RET_NON_EMPTY_STRING=`echo "${DIR_NAME_GEN_DATA}" | grep "[a-zA-Z0-9_][a-zA-Z0-9_]*/releng_generated_data$"`
|
||||
GREP_RET_GEN_DATA="$?"
|
||||
case "${GREP_RET_GEN_DATA}" in
|
||||
0)
|
||||
if [ x"${RET_NON_EMPTY_STRING}" != x"" ]; then
|
||||
# now call the nastiness
|
||||
chmod -R +w ${GEN_DATA_DIR}
|
||||
rm -rf ${GEN_DATA_DIR}
|
||||
# boldify
|
||||
printf "${SELF}: Removed (self-generated) %s\n" ${GEN_DATA_DIR}
|
||||
# unboldify
|
||||
else
|
||||
printf "FAIL : ${SELF} : Safety check for being in releng_generated_data directory.\n"
|
||||
printf "FAIL : ${SELF} : GREP returned empty string: ${RET_NON_EMPTY_STRING}.\n"
|
||||
printf "FAIL : ${SELF} : Skipped trying to remove ${GEN_DATA_DIR} directory. Exiting.\n"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf "FAIL : ${SELF} : Safety check for being in releng_generated_data directory.\n"
|
||||
printf "FAIL : ${SELF} : GREP returned code: ${GREP_RET_GEN_DATA}.\n"
|
||||
printf "FAIL : ${SELF} : Skipped trying to remove ${GEN_DATA_DIR} directory. Exiting.\n"
|
||||
exit 30
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "${SELF}: ${GEN_DATA_DIR} does not exist. Nothing to clean.\n"
|
||||
fi
|
||||
else
|
||||
# boldify
|
||||
printf "${SELF}: Leaving (self-generated) %s\n" ${GEN_DATA_DIR}
|
||||
# unboldify
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################
|
||||
check_for_xorriso() {
|
||||
# $1: if "-x" then check executability
|
||||
|
||||
if test -z "$RELENG_XORRISO" -o "$RELENG_XORRISO" = "0"
|
||||
then
|
||||
print_help
|
||||
# print_specific_help
|
||||
echo
|
||||
echo "${SELF}: Need -x absolute or relative path to xorriso binary."
|
||||
echo
|
||||
exit 31
|
||||
fi
|
||||
if [ x"$1" = x"-x" -a ! -x "$RELENG_XORRISO" ]
|
||||
then
|
||||
print_help
|
||||
# print_specific_help
|
||||
echo
|
||||
echo "${SELF}: Path given by option -x does not lead to an executable file."
|
||||
echo "Given is: '$RELENG_XORRISO'"
|
||||
if test "$RELENG_XORRISO" = "xorriso"
|
||||
then
|
||||
xorriso=$(type -p xorriso)
|
||||
if test -n "xorriso"
|
||||
then
|
||||
echo "Hint: Try '$xorriso'"
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
exit 31
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#############################################
|
||||
|
||||
# To catch the exit value of a command in a pipe
|
||||
return_value_file="$GEN_DATA_DIR"/wrapper_"$$"_return_value
|
||||
return_wrapper()
|
||||
{
|
||||
cmd="$1"
|
||||
shift 1
|
||||
"$cmd" "$@"
|
||||
RET="$?"
|
||||
echo "$RET" >"$return_value_file"
|
||||
return "$RET"
|
||||
}
|
||||
|
||||
#############################################
|
||||
|
||||
next_is=
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then :
|
||||
elif test "$next_is" = "x"
|
||||
then
|
||||
RELENG_XORRISO="$i"
|
||||
next_is=
|
||||
elif test x"$i" = x"-x"
|
||||
then
|
||||
next_is="x"
|
||||
elif test x"$i" = x"-k"
|
||||
then
|
||||
CLEANUP=0
|
||||
elif test x"$i" = x"-c"
|
||||
then
|
||||
CLEANUP=1
|
||||
cleanup
|
||||
exit 0
|
||||
elif test x"$i" = x"-f"
|
||||
then
|
||||
SIMULATE_FAILURE=1
|
||||
elif test x"$i" = x"-h"
|
||||
then
|
||||
print_help
|
||||
SPECIFIC_HELP=1
|
||||
elif test x"$i" = x"--"
|
||||
then
|
||||
# Begin of private arguments for caller
|
||||
next_is="ignore"
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown general option: $i" >&2
|
||||
print_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$next_is" = x
|
||||
then
|
||||
echo >&2
|
||||
echo "Option -x expects an argument (the path to the xorriso program)" >&2
|
||||
print_help
|
||||
exit 31
|
||||
fi
|
@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
. releng_getopts.inc
|
||||
|
||||
boldify
|
||||
printf "\ntesting boldify and unboldify..."
|
||||
unboldify
|
||||
|
||||
printf "\nSELF =${SELF}"
|
||||
printf "\nRELENG_XORRISO =${RELENG_XORRISO}"
|
||||
printf "\nSIMULATE_FAILURE =${SIMULATE_FAILURE}"
|
||||
printf "\nCLEANUP =${CLEANUP}"
|
||||
printf "\nSPECIFIC_HELP =${SPECIFIC_HELP}"
|
||||
printf "\nSTART_DIR_DONT_CHANGE =${START_DIR_DONT_CHANGE}"
|
||||
printf "\nGEN_DATA_DIR =${GEN_DATA_DIR}"
|
||||
printf "\n"
|
||||
|
||||
exit 0
|
@ -1,222 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2010, 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright (c) 2010, 2011, 2019 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# This script is distributed according to the terms of the GNU GPL v2.
|
||||
# This should be better rewritten in C at some future point. Ref: pwd code.
|
||||
|
||||
# Create a list of checksums encoded in hexadecimal format and print to
|
||||
# standard output. Checksum may be MD5 or SHA256.
|
||||
|
||||
# Format Description
|
||||
# A line in the emerging file is to be composed as follows:
|
||||
#
|
||||
# The checksum of the file content must be encoded in the aprropriate number
|
||||
# of hex digits.
|
||||
# [0-9afAF]
|
||||
#
|
||||
# Next come two blanks.
|
||||
#
|
||||
# The byte size of the file content must be encoded in 12 decimal digits
|
||||
# or blanks.
|
||||
#
|
||||
# Next come two blanks.
|
||||
#
|
||||
# The rest of the line up to the newline character is a semi-literal file
|
||||
# address. Its basename has to be the same as the basename of the data file
|
||||
# when it is used as one of the input files for the jigdo file generator.
|
||||
|
||||
# The semi-literal address and the address mapping define what will be
|
||||
# listed as file address in the jigdo file.
|
||||
# The address may bear at its start a literal text that shall be recognized by
|
||||
# the address mapping (e.g. -jigdo-map) of the jigdo file generator.
|
||||
# The rest of the address must be usable as file address in both situations:
|
||||
# When the jigdo file gets generated, and when the jigdo file gets read
|
||||
# to inflate the template file into the original payload image.
|
||||
# The address mappings at both occasions can be used to adapt to a change
|
||||
# of the absolute location of the listed files.
|
||||
# Between both mappings, the parent directory is represented by a symbolic
|
||||
# text, like "Debian:".
|
||||
|
||||
# A simple strategy to cope with this is to write absolute paths into the
|
||||
# checksum file, and to use matching absolute paths in the -jigdo-map
|
||||
# directives. Keep in mind that mapping is purely literal. Symbolic links
|
||||
# are neither resolved nor can they confuse the mapping.
|
||||
|
||||
set -e
|
||||
|
||||
SELF=jigdo-gen-md5-list
|
||||
VER=0.3
|
||||
|
||||
OPT_ABSOLUTE=1
|
||||
|
||||
# The checksum type to produce: md5 , sha256
|
||||
checksum_type=md5
|
||||
hex_length=32
|
||||
md5_cmd=
|
||||
|
||||
|
||||
# On FreeBSD there is "md5" rather than "md5sum".
|
||||
# Furthermore, the FreeBSD shell reports missing commands to inherited stderr,
|
||||
# regardless that the attempt itself has redirected stderr. Thus a sub shell
|
||||
# is needed to hide the protest.
|
||||
choose_checksum_cmd() {
|
||||
if test "$checksum_type" = "md5"
|
||||
then
|
||||
if ( md5sum --help ) >/dev/null 2>&1
|
||||
then
|
||||
md5_cmd=md5sum
|
||||
elif ( md5 -s test ) >/dev/null 2>&1
|
||||
then
|
||||
md5_cmd=md5
|
||||
else
|
||||
echo "$0 : Programs md5sum and md5 failed to work" >&2
|
||||
exit 2
|
||||
fi
|
||||
elif test "$checksum_type" = "sha256"
|
||||
then
|
||||
if ( sha256sum --help ) >/dev/null 2>&1
|
||||
then
|
||||
md5_cmd=sha256sum
|
||||
elif ( sha256 -s test ) >/dev/null 2>&1
|
||||
then
|
||||
md5_cmd=sha256
|
||||
else
|
||||
echo "$0 : Programs sha256sum and sha256 failed to work" >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat << USAGE
|
||||
usage: $SELF [option] DIR FILE ...
|
||||
Print a Jigdo checksum file to stdout. One line per FILE and per file in DIR.
|
||||
-m, --md5 produce MD5 checksums (default)
|
||||
-s, --sha256 produce SHA256 checksums
|
||||
-a, --make-absolute make absolute paths, avoiding any symlinks (default)
|
||||
-l, --keep-literal leave paths untouched, literally as supplied
|
||||
-v, --version print version
|
||||
-h, --help print help
|
||||
-e, --examples print examples
|
||||
USAGE
|
||||
}
|
||||
|
||||
examples() {
|
||||
cat << EXAMPLES
|
||||
examples:
|
||||
$SELF datadir datafile
|
||||
$SELF --keep-literal datadir datafile
|
||||
find . -type f | xargs $SELF
|
||||
find . -exec $SELF '{}' ';'
|
||||
EXAMPLES
|
||||
}
|
||||
|
||||
md5list() {
|
||||
item="$1"
|
||||
if test $OPT_ABSOLUTE -eq 1; then
|
||||
dn=`dirname "$item"` # dirname
|
||||
fn=`basename "$item"` # filename
|
||||
od=`pwd -P` # old dir
|
||||
cd "$dn" || exit 1
|
||||
item=`pwd -P`/"$fn" # absolute physical file path, avoiding all symlinks
|
||||
cd "$od" || exit 1
|
||||
fi
|
||||
if test "$md5_cmd" = "md5sum"
|
||||
then
|
||||
MD5=`md5sum "$item" | awk '{print $1}'`
|
||||
elif test "$md5_cmd" = "md5"
|
||||
then
|
||||
MD5=`md5 -q "$item"`
|
||||
elif test "$md5_cmd" = "sha256sum"
|
||||
then
|
||||
MD5=`sha256sum "$item" | awk '{print $1}'`
|
||||
elif test "$md5_cmd" = "sha256"
|
||||
then
|
||||
MD5=`sha256 -q "$item"`
|
||||
else
|
||||
echo "$0 : Internal error : Checksum mode unknown : $md5_cmd" >&2
|
||||
exit 2
|
||||
fi
|
||||
SIZ=`ls -ld "$item" | awk '{print $5}'`
|
||||
printf '%'"$hex_length"'s %12s %s\n' "$MD5" "$SIZ" "$item"
|
||||
}
|
||||
|
||||
walkdir() {
|
||||
DR="$1"
|
||||
for item in `find "$DR" -type f`
|
||||
do
|
||||
md5list "$item"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# main()
|
||||
if test "$1" = "" ; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
case "$i" in
|
||||
--md5|-m)
|
||||
checksum_type=md5
|
||||
hex_length=32
|
||||
;;
|
||||
--sha256|-s)
|
||||
checksum_type=sha256
|
||||
hex_length=64
|
||||
;;
|
||||
--make-absolute|-a)
|
||||
OPT_ABSOLUTE=1;
|
||||
shift;
|
||||
;;
|
||||
--keep-literal|-l)
|
||||
OPT_ABSOLUTE=0;
|
||||
shift;
|
||||
;;
|
||||
--version|-v)
|
||||
printf '%s %s\n' "$SELF" "$VER"
|
||||
exit 0
|
||||
;;
|
||||
--help|-h)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--examples|-e)
|
||||
examples
|
||||
exit 0
|
||||
# *)
|
||||
# usage
|
||||
# exit 1
|
||||
# ;;
|
||||
esac
|
||||
done
|
||||
choose_checksum_cmd
|
||||
|
||||
for i in "$@"
|
||||
do
|
||||
if echo "$i" | grep '^-' >/dev/null ; then
|
||||
dummy=dummy
|
||||
elif test -d "$i" ; then
|
||||
DR="$i"
|
||||
if test $OPT_ABSOLUTE -eq 1; then
|
||||
od=`pwd -P` # old dir
|
||||
cd "$DR" || exit 1
|
||||
DR=`pwd -P` # absolute physical dir path, avoiding all symlinks
|
||||
cd "$od" || exit 1
|
||||
fi
|
||||
walkdir "$DR"
|
||||
elif test -f "$i" ; then
|
||||
FL="$i"
|
||||
md5list "$FL"
|
||||
else
|
||||
usage
|
||||
exit 1
|
||||
fi;
|
||||
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -1,30 +0,0 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2.
|
||||
.TH JIGDO-GEN-MD5-LIST "1" "October 2010" "jigdo-gen-md5-list 0.1" "User Commands"
|
||||
.SH NAME
|
||||
jigdo-gen-md5-list \- create a list of MD5sums encoded in hexadecimal format and print to standard output
|
||||
.SH DESCRIPTION
|
||||
usage: jigdo\-gen\-md5\-list [option] DIR FILE ...
|
||||
.TP
|
||||
\fB\-a\fR, \fB\-\-make\-absolute\fR
|
||||
make absolute paths, avoiding any symlinks (default)
|
||||
.TP
|
||||
\fB\-l\fR, \fB\-\-keep\-literal\fR
|
||||
leave paths untouched, literally as supplied
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
print version
|
||||
.TP
|
||||
\fB\-h\fR, \fB\-\-help\fR
|
||||
print help
|
||||
.TP
|
||||
\fB\-e\fR, \fB\-\-examples\fR
|
||||
print examples
|
||||
.SH FORMAT
|
||||
|
||||
File format is described in the beginning of the script itself.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
xorriso(1), jigdo-lite(1), jigit-mkimage(1)
|
||||
|
||||
.SH AUTHOR
|
||||
Written by George Danchev <danchev@spnet.net> and Thomas Schmitt <scdbackup@gmx.net>
|
@ -1,256 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
#
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
set -e
|
||||
# set -x
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
--dev path use path as drive address. Default: /dev/cdrw
|
||||
--what path use path as address of the directory which shall
|
||||
be copied into an ISO 9660 filesystem on media.
|
||||
--any_media allow non re-usable MMC media, like CD-R or DVD+R.
|
||||
Allow paths to non-existing files, but disallow paths
|
||||
to existing regular files.
|
||||
--priv_cmd 'command [arg [arg ...]]'
|
||||
With drive operations execute xorriso as argument
|
||||
of the given command (e.g. pfexec, sudo) with the
|
||||
optionally given arguments: command arg arg xorriso ...
|
||||
Command and arguments must be single words.
|
||||
Overview:
|
||||
Test burning to re-usable media CD-RW, DVD-RW, DVD-RAM, DVD+RW, BD-RE.
|
||||
By default, one-time usable media will be rejected deliberately.
|
||||
HLP
|
||||
}
|
||||
|
||||
wait_for_dev () {
|
||||
# $1 = device address
|
||||
timeout=30
|
||||
counter=0
|
||||
|
||||
while test "$counter" -lt "$timeout"
|
||||
do
|
||||
if test -e "$1"
|
||||
then
|
||||
echo
|
||||
return 0
|
||||
fi
|
||||
if test "$counter" = 0
|
||||
then
|
||||
echo
|
||||
echo "Not existing: $dev"
|
||||
echo "Will wait up to $timeout seconds for it to appear."
|
||||
fi
|
||||
counter=$(expr $counter + 1)
|
||||
echo -n "$counter "
|
||||
sleep 1
|
||||
done
|
||||
echo
|
||||
return 1
|
||||
}
|
||||
|
||||
getopts_inc=inc/releng_getopts.inc
|
||||
if test -e "$getopts_inc"
|
||||
then
|
||||
. "$getopts_inc"
|
||||
if test "$SPECIFIC_HELP" = 1
|
||||
then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo >&2
|
||||
echo "File not found: $getopts_inc" >&2
|
||||
echo "Are we in the ./releng directory of a libisoburn SVN checkout ?" >&2
|
||||
echo "(Please execute the tests from that ./releng directory.)" >&2
|
||||
echo >&2
|
||||
exit 29
|
||||
fi
|
||||
|
||||
# Set default values for specific option variables.
|
||||
dev=/dev/cdrw
|
||||
what=../xorriso
|
||||
any_media=0
|
||||
priv_cmd=
|
||||
# Interpret specific options, they begin after the first --.
|
||||
next_is=ignore
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then
|
||||
if test "$i" = "--"
|
||||
then
|
||||
next_is=""
|
||||
fi
|
||||
elif test "$next_is" = "dev"
|
||||
then
|
||||
dev="$i"
|
||||
next_is=""
|
||||
elif test "$next_is" = "what"
|
||||
then
|
||||
what="$i"
|
||||
next_is=""
|
||||
elif test "$next_is" = "priv_cmd"
|
||||
then
|
||||
priv_cmd="$i"
|
||||
next_is=""
|
||||
elif test "$i" = "--dev"
|
||||
then
|
||||
next_is="dev"
|
||||
elif test "$i" = "--what"
|
||||
then
|
||||
next_is="what"
|
||||
elif test "$i" = "--any_media"
|
||||
then
|
||||
any_media=1
|
||||
elif test "$i" = "--priv_cmd"
|
||||
then
|
||||
next_is="priv_cmd"
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown test specific option: $i" >&2
|
||||
print_help
|
||||
print_specific_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
check_for_xorriso -x
|
||||
|
||||
|
||||
# check data dir, if any and after checking -x xorriso
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
|
||||
exit 30
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
|
||||
#####################################################################
|
||||
|
||||
# Inspect drive address
|
||||
if test -e "$dev"
|
||||
then
|
||||
if test "$any_media" = 1 -a -f "$dev"
|
||||
then
|
||||
echo "FAIL : ${SELF} : --dev $dev leads to an existing regular file"
|
||||
echo
|
||||
cleanup
|
||||
exit 31
|
||||
fi
|
||||
else
|
||||
if test "$any_media" = "0"
|
||||
then
|
||||
echo "FAIL : ${SELF} : --dev $dev does not lead to an existing file"
|
||||
echo
|
||||
cleanup
|
||||
exit 31
|
||||
fi
|
||||
fi
|
||||
|
||||
# Inspect media
|
||||
set +e
|
||||
wait_for_dev "$dev"
|
||||
res=$(${priv_cmd} "$RELENG_XORRISO" -outdev "$dev" 2>&1)
|
||||
ret=$?
|
||||
set -e
|
||||
if test "$ret" -ne 0
|
||||
then
|
||||
echo "$res" >&2
|
||||
echo "FAIL : ${SELF} : Non-zero exit value $ret with: ${priv_cmd} $RELENG_XORRISO -outdev $dev"
|
||||
echo
|
||||
cleanup
|
||||
exit 1
|
||||
elif echo "$res" | grep '^Media current:' >/dev/null 2>&1
|
||||
then
|
||||
media=$(echo "$res" | grep '^Media current:' | \
|
||||
sed -e 's/^Media current: //')
|
||||
echo "Detected media: '$media'"
|
||||
if test "$media" = "CD-RW" -o "$media" = "DVD-RW sequential recording" -o \
|
||||
"$media" = "DVD-RW restricted overwrite" -o "$media" = "DVD-RAM" -o \
|
||||
"$media" = "DVD+RW" -o "$media" = "BD-RE"
|
||||
then
|
||||
echo "Recognized as re-usable."
|
||||
elif test "$media" = "is not recognizable"
|
||||
then
|
||||
echo "FAIL : ${SELF} : No recognizable media detected in: '$dev'"
|
||||
echo
|
||||
cleanup
|
||||
exit 2
|
||||
elif test "$any_media" = 1
|
||||
then
|
||||
echo "Accepted media only because of option --any_media : '$media'"
|
||||
else
|
||||
echo "FAIL : ${SELF} : No re-usable media detected, but: '$media'"
|
||||
echo
|
||||
cleanup
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Perform burn run
|
||||
echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -outdev "$dev" -blank as_needed -map "$what" /test
|
||||
set +e
|
||||
wait_for_dev "$dev"
|
||||
${priv_cmd} "$RELENG_XORRISO" \
|
||||
-for_backup \
|
||||
-outdev "$dev" \
|
||||
-blank as_needed \
|
||||
-map "$what" /test
|
||||
ret=$?
|
||||
set -e
|
||||
if test "$ret" -ne 0
|
||||
then
|
||||
echo "FAIL : ${SELF} : Non-zero exit value with burn run: $ret"
|
||||
echo
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test "$SIMULATE_FAILURE" = 1
|
||||
then
|
||||
echo "FAIL : ${SELF} : Simulated failure caused by option -f"
|
||||
if test -f "$dev"
|
||||
then
|
||||
# Alter image
|
||||
dd if=/dev/urandom bs=2K count=1 \
|
||||
of="$dev" conv=notrunc seek=400
|
||||
else
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check read
|
||||
echo ${priv_cmd} "$RELENG_XORRISO" -for_backup -indev "$dev" \
|
||||
-check_media event=FATAL -- \ -check_md5_r FATAL / --
|
||||
set +e
|
||||
wait_for_dev "$dev"
|
||||
${priv_cmd} "$RELENG_XORRISO" \
|
||||
-for_backup \
|
||||
-indev "$dev" \
|
||||
-print '---check_media:' -check_media event=FATAL -- \
|
||||
-print '---check_md5_r:' -check_md5_r FATAL / -- \
|
||||
-print '---compare_r:' -md5 off -compare_r "$what" /test
|
||||
ret=$?
|
||||
set -e
|
||||
if test "$ret" -ne 0
|
||||
then
|
||||
echo "FAIL : ${SELF} : Non-zero exit value with checkread run: $ret"
|
||||
echo
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Ok. Burn test passed."
|
||||
echo
|
||||
cleanup
|
||||
exit 0
|
@ -1,188 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
# set -e
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
--dev path Suppress dialog and use path as drive address.
|
||||
--priv_cmd 'command [arg [arg ...]]'
|
||||
With drive operations execute xorriso as argument
|
||||
of the given command (e.g. pfexec, sudo) with the
|
||||
optionally given arguments: command arg arg xorriso ...
|
||||
Command and arguments must be single words.
|
||||
Overview:
|
||||
Test device scanning and list of speeds.
|
||||
HLP
|
||||
}
|
||||
|
||||
# Include common bits and interpret general options
|
||||
getopts_inc=inc/releng_getopts.inc
|
||||
if test -e "$getopts_inc"
|
||||
then
|
||||
. "$getopts_inc"
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1
|
||||
then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo >&2
|
||||
echo "File not found: $getopts_inc" >&2
|
||||
echo "Are we in the ./releng directory of a libisoburn SVN checkout ?" >&2
|
||||
echo "(Please execute the tests from that ./releng directory.)" >&2
|
||||
echo >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Interpret private options, they begin after the first --.
|
||||
dev=
|
||||
priv_cmd=
|
||||
next_is=ignore
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then
|
||||
if test "$i" = "--"
|
||||
then
|
||||
next_is=""
|
||||
fi
|
||||
elif test "$next_is" = "dev"
|
||||
then
|
||||
dev="$i"
|
||||
next_is=""
|
||||
elif test "$next_is" = "priv_cmd"
|
||||
then
|
||||
priv_cmd="$i"
|
||||
next_is=""
|
||||
elif test "$i" = "--dev"
|
||||
then
|
||||
next_is="dev"
|
||||
elif test "$i" = "--priv_cmd"
|
||||
then
|
||||
next_is="priv_cmd"
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown test specific option: $i" >&2
|
||||
print_help
|
||||
print_specific_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
|
||||
# Insist in having a xorriso
|
||||
check_for_xorriso -x
|
||||
|
||||
has_device_links=$("$RELENG_XORRISO" -help 2>/dev/null | fgrep ' -device_links')
|
||||
if test -n "$has_device_links"
|
||||
then
|
||||
devices_opt="-device_links"
|
||||
else
|
||||
devices_opt="-devices"
|
||||
fi
|
||||
|
||||
#
|
||||
get_speeds() {
|
||||
echo -e "\n${SELF}: Running: ${priv_cmd} ${RELENG_XORRISO} -report_about WARNING -outdev ${1} -toc -list_formats -list_profiles out -list_speeds"
|
||||
${priv_cmd} "$RELENG_XORRISO" -report_about WARNING -outdev "$1" \
|
||||
-print '---toc :' -toc \
|
||||
-print '---list_formats :' -list_formats \
|
||||
-print '---list_profiles :' -list_profiles out \
|
||||
-print '---list_speeds :' -list_speeds
|
||||
}
|
||||
|
||||
cat_var() {
|
||||
# $1 = variable to put out with line feeds
|
||||
cat <<+
|
||||
$1
|
||||
+
|
||||
}
|
||||
|
||||
get_devices() {
|
||||
# $1 = if not empty: device lines from xorriso -devices or -device_links
|
||||
# $2 = if not empty: suppress dialog and use $2 as input
|
||||
|
||||
if test -n "$1"
|
||||
then
|
||||
DEVICES="$1"
|
||||
else
|
||||
DEVICES=$( ${priv_cmd} "$RELENG_XORRISO" $devices_opt 2>/dev/null | grep "\-dev")
|
||||
fi
|
||||
NUM_DEV=$(cat_var "$DEVICES" | wc -l)
|
||||
case "${NUM_DEV}" in
|
||||
0)
|
||||
echo -e "\n${SELF}: No drives found."
|
||||
exit 1
|
||||
;;
|
||||
1)
|
||||
echo -e "\n${SELF}: 1 drive found:\n"
|
||||
;;
|
||||
*)
|
||||
echo -e "\n${SELF}: ${NUM_DEV} drives found:\n"
|
||||
;;
|
||||
esac
|
||||
echo =================================================================
|
||||
echo "$DEVICES"
|
||||
echo =================================================================
|
||||
|
||||
OUTDEV=$( cat_var "$DEVICES" | head -1 | \
|
||||
sed -e "s/[0-9] *-dev '\//\//" -e "s/'.*$//" )
|
||||
if test -n "$2"
|
||||
then
|
||||
x="$2"
|
||||
else
|
||||
echo >&2
|
||||
echo "WARNING: The following tests might pull in the drive tray." >&2
|
||||
echo " Best is if you now put in a suitable media and" >&2
|
||||
echo " load it manually, so nobody gets surprised. :))" >&2
|
||||
echo >&2
|
||||
echo "Which drive to examine ? (Empty input = ${OUTDEV})" >&2
|
||||
read x
|
||||
fi
|
||||
if test -n "$x"
|
||||
then
|
||||
OUTDEV="$x"
|
||||
fi
|
||||
|
||||
get_speeds "$OUTDEV"
|
||||
}
|
||||
|
||||
# main
|
||||
"$RELENG_XORRISO" -version
|
||||
echo -e "\n${SELF}: Running: $RELENG_XORRISO $devices_opt ..."
|
||||
devices=$( ${priv_cmd} "$RELENG_XORRISO" -report_about WARNING $devices_opt | grep "\-dev")
|
||||
RET="$?"
|
||||
if test "$SIMULATE_FAILURE" = 1
|
||||
then
|
||||
echo "===" >&2
|
||||
echo "=== SIMULATING FAILURE BY OVERRIDING EXIT VALUE OF XORRISO" >&2
|
||||
echo "===" >&2
|
||||
echo "FAIL : ${SELF} : Simulated failure caused by option -f"
|
||||
RET=1
|
||||
fi
|
||||
case ${RET} in
|
||||
0)
|
||||
get_devices "$devices" "$dev"
|
||||
RET="$?"
|
||||
if test "$RET" = 0
|
||||
then :
|
||||
else
|
||||
echo "FAIL : ${SELF} : Device scan or single drive listing failed"
|
||||
exit "$RET"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
boldify
|
||||
echo -ne "\n${SELF}: ${priv_cmd} ${RELENG_XORRISO} $devices_opt returned ${RET}."
|
||||
unboldify
|
||||
echo -e "\n${SELF}: Already mounted?"
|
||||
df -kh
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
@ -1,320 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011, 2019 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
set -e
|
||||
|
||||
not_in_releng_exit() {
|
||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||
exit 1
|
||||
}
|
||||
|
||||
. inc/releng_getopts.inc || not_in_releng_exit
|
||||
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
--md5 use MD5 checksums (default)
|
||||
--sha256 use SHA256 checksums
|
||||
Overview:
|
||||
Match the resulting ISO image representation
|
||||
against the jigdo representation.
|
||||
HLP
|
||||
}
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1; then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set default values for specific option variables.
|
||||
checksum_type=md5
|
||||
# Interpret specific options, they begin after the first --.
|
||||
next_is=ignore
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then
|
||||
if test "$i" = "--"
|
||||
then
|
||||
next_is=""
|
||||
fi
|
||||
elif test "$i" = "--md5"
|
||||
then
|
||||
checksum_type=md5
|
||||
elif test "$i" = "--sha256"
|
||||
then
|
||||
checksum_type=sha256
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown test specific option: $i" >&2
|
||||
print_help
|
||||
print_specific_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -x $RELENG_XORRISO ]; then
|
||||
print_help
|
||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||
exit 30
|
||||
fi
|
||||
|
||||
# check data dir, if any and after checking -x xorriso
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use './${SELF} -c' to remove.\n"
|
||||
exit 1
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
TMP_DATA_DIR=releng_generated_data
|
||||
IMG_EXTRACT_DIR=${GEN_DATA_DIR}/${SELF}_extracted_tree
|
||||
RELENG_DIR="${IMG_EXTRACT_DIR}"
|
||||
RELENG_ISOLINUX_BIN="isolinux/isolinux.bin"
|
||||
RELENG_BOOT_CAT="isolinux/boot.cat"
|
||||
RELENG_IMG=t1
|
||||
RES=""
|
||||
REMOTE_URL="http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/i386/iso-cd"
|
||||
REMOTE_IMG="debian-testing-i386-netinst.iso"
|
||||
|
||||
# check for required items
|
||||
if [ "${RELENG_XORRISO}" = "" -o "${RELENG_DIR}" = "" -o "${RELENG_IMG}" = "" ]; then
|
||||
echo -e "\n${SELF}: xorriso_cmd IN_dir and OUT_image are required\n"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# All must be set at this point
|
||||
printf "${SELF}: Config items:"
|
||||
printf "\n\txorriso_cmd=${RELENG_XORRISO}\n\tIN_dir=${RELENG_DIR}\n\tOUT_image=${RELENG_IMG}.iso"
|
||||
printf "\n\tIN_isolinux=${RELENG_ISOLINUX_BIN}\n\tOUT_bootcat=${RELENG_BOOT_CAT}\n"
|
||||
RES="${RELENG_IMG}.iso ${RELENG_IMG}.new ${RELENG_IMG}.md5 ${RELENG_IMG}.jigdo ${RELENG_IMG}.template"
|
||||
|
||||
# xorriso version details, incl. underlying libraries
|
||||
# "${RELENG_XORRISO}" -version
|
||||
|
||||
# check whether the binary support JTE
|
||||
set +e
|
||||
RETSTR_VER_JTE=`"${RELENG_XORRISO}" --version 2>/dev/null | grep "libjte * in use"`
|
||||
RETCODE_VER_JTE="$?"
|
||||
set -e
|
||||
case ${RETCODE_VER_JTE} in
|
||||
0)
|
||||
printf "\n${SELF}: Found JTE support with ${RELENG_XORRISO} : ${RETSTR_VER_JTE}"
|
||||
;;
|
||||
*)
|
||||
printf "\nFAIL : ${SELF} : Not found JTE support in ${RELENG_XORRISO}. Quit."
|
||||
printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit >=1.18 and rebuild."
|
||||
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
||||
cleanup
|
||||
exit 4
|
||||
;;
|
||||
esac
|
||||
|
||||
# grab remote ISO image, to decompose
|
||||
if [ -L "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
printf "\n${SELF}: Found symbolic link ${TMP_DATA_DIR}"/"${REMOTE_IMG}\n"
|
||||
ls -ld ${TMP_DATA_DIR}"/"${REMOTE_IMG}
|
||||
elif [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n"
|
||||
if wget -V >/dev/null 2>&1
|
||||
then
|
||||
set +e
|
||||
wget --no-check-certificate -T20 -t3 \
|
||||
-O "${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}"
|
||||
WGET_RET="$?"
|
||||
set -e
|
||||
elif fetch -T 20 -o "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \
|
||||
"${REMOTE_URL}"/"${REMOTE_IMG}"
|
||||
then
|
||||
WGET_RET=0
|
||||
else
|
||||
echo
|
||||
echo "FAIL: ${SELF} : Neither wget nor fetch are present and willing to work"
|
||||
cleanup
|
||||
exit 10
|
||||
fi
|
||||
case ${WGET_RET} in
|
||||
0)
|
||||
echo -e "\n${SELF}: Downloading successfully completed.\n"
|
||||
;;
|
||||
*)
|
||||
echo -e "\nFAIL : ${SELF} : wget returned code: $WGET_RET\n"
|
||||
rm "${TMP_DATA_DIR}"/"${REMOTE_IMG}"
|
||||
cleanup
|
||||
exit 5
|
||||
;;
|
||||
esac
|
||||
else
|
||||
printf "\n${SELF}: Found ISO image: ${TMP_DATA_DIR}/${REMOTE_IMG}\n"
|
||||
fi
|
||||
|
||||
# check for extraction directory existence
|
||||
if [ -d "${IMG_EXTRACT_DIR}" ]; then
|
||||
printf "\n${SELF}: Found ${IMG_EXTRACT_DIR}. Please cleanup.\n"
|
||||
cleanup
|
||||
exit 6
|
||||
else
|
||||
mkdir "${IMG_EXTRACT_DIR}"
|
||||
fi
|
||||
|
||||
# extract image content
|
||||
CMD_EXTRACT="${RELENG_XORRISO} -indev ${TMP_DATA_DIR}/${REMOTE_IMG} \
|
||||
-osirrox on:auto_chmod_on \
|
||||
-extract / ${IMG_EXTRACT_DIR} \
|
||||
"
|
||||
|
||||
# TODO: drop set +e|-e block, catch exit code instead when
|
||||
# the boot catalog warnings get completely resolved.
|
||||
echo -e "${SELF}: Extracting ISO image:\n${CMD_EXTRACT}\n"
|
||||
set +e
|
||||
${CMD_EXTRACT}
|
||||
set -e
|
||||
|
||||
# grab an MBR
|
||||
ISOHYBRID_MBR="${GEN_DATA_DIR}/isohybrid.mbr"
|
||||
dd if="${TMP_DATA_DIR}/${REMOTE_IMG}" bs=1K count=32 of="${ISOHYBRID_MBR}"
|
||||
|
||||
# create FAT partition
|
||||
APPEND_PART="${GEN_DATA_DIR}/fatpart.fat"
|
||||
MKFS_MSDOS="/sbin/mkfs.msdos"
|
||||
if [ -x "${MKFS_MSDOS}" ]; then
|
||||
"${MKFS_MSDOS}" -n Bla -C "${APPEND_PART}" 8192
|
||||
APPEND_PART_CMD="-append_partition 2 0x01 ${APPEND_PART}"
|
||||
else
|
||||
APPEND_PART_CMD=
|
||||
|
||||
# printf "\nFAIL : ${SELF} : Not found: ${MKFS_MSDOS}"
|
||||
# printf "\n${SELF}: Not found: "${MKFS_MSDOS}". Install dosfstools."
|
||||
# printf "\n${SELF}: http://www.daniel-baumann.ch/software/dosfstools/\n"
|
||||
# cleanup
|
||||
# exit 7
|
||||
fi
|
||||
|
||||
# GENERAL section
|
||||
CMD="${RELENG_XORRISO} \
|
||||
-as mkisofs \
|
||||
-quiet \
|
||||
-o ${GEN_DATA_DIR}/${RELENG_IMG}.iso \
|
||||
-R \
|
||||
-V ISOJIGDO \
|
||||
-partition_offset 16 \
|
||||
-J -joliet-long \
|
||||
"
|
||||
|
||||
# BOOT section
|
||||
if [ -f "${IMG_EXTRACT_DIR}"/"${RELENG_ISOLINUX_BIN}" -a -f "${ISOHYBRID_MBR}" ]
|
||||
then
|
||||
CMD="$CMD \
|
||||
-b ${RELENG_ISOLINUX_BIN} \
|
||||
-c ${RELENG_BOOT_CAT} \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-isohybrid-mbr ${ISOHYBRID_MBR} \
|
||||
-partition_offset 16 \
|
||||
"
|
||||
else
|
||||
printf "\n${SELF}: FAIL to compose the boot section.\n"
|
||||
cleanup
|
||||
exit 8
|
||||
fi
|
||||
if [ -n "${APPEND_PART_CMD}" -a -f "${APPEND_PART}" ]; then
|
||||
CMD="$CMD \
|
||||
${APPEND_PART_CMD}
|
||||
"
|
||||
fi
|
||||
|
||||
# JIGDO section
|
||||
JIGDO_JIGDO=${GEN_DATA_DIR}/${RELENG_IMG}.jigdo
|
||||
JIGDO_TEMPLATE=${GEN_DATA_DIR}/${RELENG_IMG}.template
|
||||
|
||||
JIGDO_MAP_RHV=$(cd ${RELENG_DIR} 2>/dev/null && pwd)
|
||||
|
||||
JIGDO_MAP="Debian=${JIGDO_MAP_RHV}/"
|
||||
|
||||
# create jigdo MD5 list in base64 format
|
||||
JIGDO_GEN_MD5=${GEN_DATA_DIR}/${RELENG_IMG}.md5
|
||||
|
||||
printf "${SELF}: Creating $checksum_type list in hex format in ${JIGDO_GEN_MD5}..."
|
||||
set +e
|
||||
./jigdo-gen-md5-list "--""$checksum_type" ${RELENG_DIR} > ${JIGDO_GEN_MD5}
|
||||
ret=$?
|
||||
set -e
|
||||
|
||||
if test "$ret" = 0
|
||||
then
|
||||
printf "Done.\n"
|
||||
else
|
||||
printf "\nFAIL : ${SELF}: ./jigdo-gen-md5-list returns $ret"
|
||||
cleanup
|
||||
exit 9
|
||||
fi
|
||||
|
||||
|
||||
CMD="$CMD \
|
||||
-jigdo-template-compress gzip \
|
||||
-jigdo-checksum-algorithm "$checksum_type" \
|
||||
-checksum_algorithm_iso md5,sha1,sha256,sha512 \
|
||||
-checksum_algorithm_template md5,sha1,sha256,sha512 \
|
||||
-jigdo-jigdo ${JIGDO_JIGDO} \
|
||||
-jigdo-template ${JIGDO_TEMPLATE} \
|
||||
-jigdo-map ${JIGDO_MAP} \
|
||||
-checksum-list ${JIGDO_GEN_MD5} \
|
||||
-jigdo-min-file-size 1024 \
|
||||
"
|
||||
|
||||
CMD="$CMD ${RELENG_DIR}"
|
||||
|
||||
# Run the whole compound command
|
||||
echo -e "${SELF}: Creating ISO and jigdo representations:\n$CMD\n"
|
||||
${CMD}
|
||||
|
||||
# Create another imange this time from jigdo files
|
||||
if which jigit-mkimage >/dev/null 2>&1; then
|
||||
printf "${SELF}: Creating new ISO from jigdo files..."
|
||||
jigit-mkimage \
|
||||
-t ${JIGDO_TEMPLATE} \
|
||||
-j ${JIGDO_JIGDO} \
|
||||
-m ${JIGDO_MAP} \
|
||||
-o ${GEN_DATA_DIR}/${RELENG_IMG}.new
|
||||
printf "Done.\n"
|
||||
else
|
||||
printf "\n${SELF}: Not found: jigit-mkimage. Install jigit."
|
||||
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
||||
cleanup
|
||||
exit 10
|
||||
fi
|
||||
|
||||
# trap the exit code of diff and let the Universe explode
|
||||
diff ${GEN_DATA_DIR}/${RELENG_IMG}.iso ${GEN_DATA_DIR}/${RELENG_IMG}.new
|
||||
DIFF_RET="$?"
|
||||
case ${DIFF_RET} in
|
||||
0)
|
||||
echo -e "${SELF}: Match: diff ${GEN_DATA_DIR}/${RELENG_IMG}.iso ${GEN_DATA_DIR}/${RELENG_IMG}.new"
|
||||
;;
|
||||
*)
|
||||
echo -e "FAIL : ${SELF} : diff returned code: $DIFF_RET\n"
|
||||
;;
|
||||
esac
|
||||
|
||||
# sort out the cruft
|
||||
cleanup
|
||||
|
||||
# warn about downloaded image left behind
|
||||
if [ -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
printf "${SELF}: Leaving "
|
||||
ls -sh "${TMP_DATA_DIR}"/"${REMOTE_IMG}"
|
||||
fi
|
||||
|
||||
# last hints
|
||||
if [ -d ${GEN_DATA_DIR} ]; then
|
||||
printf "\n${SELF}: HINT: manual checks remained to be done:\n"
|
||||
printf " * ${GEN_DATA_DIR}/${RELENG_IMG}.iso boots from USB stick and/or optical media.\n"
|
||||
printf " * appended FAT partition is mountable.\n"
|
||||
printf " * xorriso -indev ${GEN_DATA_DIR}/${RELENG_IMG}.iso -pvd_info\n"
|
||||
printf " * fdisk -lu ${GEN_DATA_DIR}/${RELENG_IMG}.iso\n"
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,277 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright 2011 - 2014 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
set -e
|
||||
|
||||
export RELENG_SCRIPT_RUN_BY_RUN_ALL_AUTO=1
|
||||
|
||||
SELF=$(basename "$0")
|
||||
GEN_DATA_DIR=releng_generated_data
|
||||
CLOG=${GEN_DATA_DIR}/log.${SELF}
|
||||
CLOG_PREV=${CLOG}.prev
|
||||
PASSED_OPTIONS="$@"
|
||||
RELENG_XORRISO=
|
||||
CLEANUP_LOG=0
|
||||
|
||||
# It is not a good idea to include inc/releng_getopts.inc with the
|
||||
# master script as it calls the subordinate scripts and they include
|
||||
# this file too, and we want to avoid sharing variable with subshells
|
||||
if [ ! -f inc/releng_getopts.inc ]; then
|
||||
printf "\nPlease execute the tests from releng directory.\n\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# To catch the exit value of a command in a pipe
|
||||
return_value_file="$GEN_DATA_DIR"/run_all_"$$"_return_value
|
||||
return_wrapper()
|
||||
{
|
||||
cmd="$1"
|
||||
shift 1
|
||||
"$cmd" "$@"
|
||||
RET="$?"
|
||||
echo "$RET" >"$return_value_file"
|
||||
return "$RET"
|
||||
}
|
||||
|
||||
# Using only bash builtin commands.
|
||||
# On 4 year old amd64 x2 3000 MHz, xterm local,it counts 22471 lines per second
|
||||
# On 2 year old amd64 x4 2600 MHz, ssh remote, it counts 35348 lines per second
|
||||
count_lines()
|
||||
{
|
||||
# $1 if not empty: start count
|
||||
line=
|
||||
if test -n "$1"
|
||||
then
|
||||
count="$1"
|
||||
else
|
||||
count=0
|
||||
fi
|
||||
while read line
|
||||
do
|
||||
count=$(($count + 1))
|
||||
printf "\r %4d lines logged ... " "$count" >&2
|
||||
printf "%s\n" "$line"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
#############################################
|
||||
# copied from releng/inc/releng_getopts.inc which is not included here.
|
||||
boldify() {
|
||||
if which tput >/dev/null 2>&1
|
||||
then
|
||||
tput smso || dummy_variable=1
|
||||
fi
|
||||
}
|
||||
|
||||
unboldify() {
|
||||
if which tput >/dev/null 2>&1
|
||||
then
|
||||
tput rmso || dummy_variable=1
|
||||
fi
|
||||
}
|
||||
|
||||
#############################################
|
||||
print_usage()
|
||||
{
|
||||
cat << HLP
|
||||
|
||||
${SELF} runs executables from releng directory starting with auto_*,
|
||||
and passing them its own options. stdout/stderr output is stored in:
|
||||
./${CLOG} (last run) and
|
||||
./${CLOG_PREV} (previous run)
|
||||
|
||||
Usage: ${SELF} -x path/to/xorriso [-k] [-c] [-h]
|
||||
-x absolute or relative path to xorriso binary to be run.
|
||||
-k keep self-generated data in ./${GEN_DATA_DIR}.
|
||||
-c cleanup self-generated data kept from previous run and exit.
|
||||
-h print this help text
|
||||
|
||||
Examples:
|
||||
# run xorriso and keep the self-generated data
|
||||
$ ./${SELF} -x path/to/xorriso -k
|
||||
|
||||
# clean up self-generated data from previous run
|
||||
$ ./${SELF} -c
|
||||
|
||||
HLP
|
||||
}
|
||||
|
||||
#############################################
|
||||
if [ ! "${1}" ]; then
|
||||
print_usage
|
||||
exit 0
|
||||
fi
|
||||
next_is=
|
||||
for i in "$@"
|
||||
do
|
||||
if test x"$i" = x"-h" -o x"$i" = x"--h" -o x"$i" = x"-help" -o x"$i" = x"--help"
|
||||
then :
|
||||
print_usage
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test "$next_is" = "ignore"
|
||||
then :
|
||||
elif test "$next_is" = "x"
|
||||
then
|
||||
RELENG_XORRISO="$i"
|
||||
next_is=
|
||||
elif test x"$i" = x"-x"
|
||||
then
|
||||
next_is="x"
|
||||
elif test x"$i" = x"-c"
|
||||
then
|
||||
CLEANUP_LOG=1
|
||||
fi
|
||||
done
|
||||
#############################################
|
||||
if test "$next_is" = x
|
||||
then
|
||||
echo
|
||||
echo "Option -x expects an argument (the path to the xorriso program)"
|
||||
exit 31
|
||||
fi
|
||||
|
||||
|
||||
########################################################
|
||||
if [ -f "${CLOG}" ]; then
|
||||
mv "${CLOG}" "${CLOG_PREV}"
|
||||
fi
|
||||
> ${CLOG}
|
||||
if [ -x "${RELENG_XORRISO}" ]; then
|
||||
echo "_OVERVIEW_______________________________________________________________" >> ${CLOG}
|
||||
date -u >> ${CLOG}
|
||||
${RELENG_XORRISO} --version >> ${CLOG}
|
||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" >> ${CLOG}
|
||||
fi
|
||||
DSTART=`date -u`
|
||||
echo "${SELF}: Started at ${DSTART}" | tee -a ${CLOG}
|
||||
E1=`date '+%s'`
|
||||
exit_value=0
|
||||
# require ^auto_, avoid running (your)self explicitly
|
||||
for s in `ls | grep ^auto_ | grep -v ${SELF} | sort -n`; do
|
||||
if [ -x ${s} -a ! -d ${s} ]; then
|
||||
echo >> ${CLOG}
|
||||
echo >> ${CLOG}
|
||||
echo "_STARTING_TEST_________________________________________________________" >> ${CLOG}
|
||||
echo "${SELF}: Running ./${s} ${PASSED_OPTIONS} :" \
|
||||
| tee -a ${CLOG}
|
||||
T1=`date '+%s'`
|
||||
set +e
|
||||
|
||||
return_wrapper ./${s} ${PASSED_OPTIONS} 2>&1 | count_lines >> ${CLOG}
|
||||
RET=$(cat "$return_value_file")
|
||||
rm "$return_value_file"
|
||||
|
||||
# echo "RET='$RET'" >/dev/tty
|
||||
|
||||
T2=`date '+%s'`
|
||||
TS=`expr ${T2} - ${T1}`
|
||||
case ${RET} in
|
||||
0)
|
||||
echo "done in ${TS} sec. ok."
|
||||
;;
|
||||
*)
|
||||
exit_value=2
|
||||
printf "done in ${TS} sec. "
|
||||
boldify
|
||||
printf "FAIL -> EXIT CODE $RET"
|
||||
unboldify
|
||||
echo
|
||||
;;
|
||||
esac
|
||||
set -e
|
||||
fi
|
||||
done
|
||||
|
||||
DEND=`date -u`
|
||||
echo | tee -a ${CLOG}
|
||||
echo -n "${SELF}: Stopped at ${DEND}." | tee -a ${CLOG}
|
||||
if [ "${CLEANUP_LOG}" -eq 1 ]; then
|
||||
if [ -f "${CLOG}" ]; then
|
||||
rm -f "${CLOG}"
|
||||
echo # | tee -a ${CLOG}
|
||||
echo -n "${SELF}: Removed my own log ${CLOG}." # | tee -a ${CLOG}
|
||||
fi
|
||||
if [ -f "${CLOG_PREV}" ]; then
|
||||
rm -f "${CLOG_PREV}"
|
||||
echo # | tee -a ${CLOG}
|
||||
echo "${SELF}: Removed my own log ${CLOG_PREV}." # | tee -a ${CLOG}
|
||||
fi
|
||||
else
|
||||
E2=`date '+%s'`
|
||||
if [ ${E2} -eq ${E1} ]; then
|
||||
echo " Total elapsed 0 sec." | tee -a ${CLOG}
|
||||
else
|
||||
ES=`expr ${E2} - ${E1}`
|
||||
echo " Total elapsed ${ES} sec." | tee -a ${CLOG}
|
||||
fi
|
||||
#####
|
||||
echo >> ${CLOG}
|
||||
echo "_SUMMARY________________________________________________________________" >> ${CLOG}
|
||||
echo "${SELF}: Trivial log examination: ${CLOG}" | tee -a ${CLOG}
|
||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
|
||||
# severity classes of libdax_msgs.h in libburn and libisofs
|
||||
# List of boring keywords:
|
||||
# 'UPDATE|NOTE|DEBUG|ALL' - not considered interesting for lazy log inspection.
|
||||
# List of interesting keywords:
|
||||
# thrown by xorriso and underlying libraries
|
||||
LIST_KWD="NEVER|ABORT|FATAL|FAILURE|MISHAP|SORRY|WARNING|HINT"
|
||||
# thrown by others
|
||||
LIST_KWD="${LIST_KWD}|FAIL|ERROR|WRONG"
|
||||
|
||||
if [ -f "${CLOG}" ]; then
|
||||
set +e
|
||||
# lines, perl regex, leading tabs
|
||||
grep -n -E "${LIST_KWD}" "${CLOG}"
|
||||
RET_GREP="$?"
|
||||
ok=0
|
||||
case ${RET_GREP} in
|
||||
0) # found
|
||||
;;
|
||||
1) # not found
|
||||
echo "${SELF}: Log file looks clear." # | tee -a ${CLOG}
|
||||
ok=1
|
||||
;;
|
||||
*) #
|
||||
echo "${SELF}: grep returned EXIT CODE: ${RET_GREP}." # | tee -a ${CLOG}
|
||||
;;
|
||||
esac
|
||||
if test "$ok" = 0 && test "$exit_value" = 0
|
||||
then
|
||||
exit_value=1
|
||||
fi
|
||||
set -e
|
||||
fi
|
||||
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
|
||||
|
||||
##### TODO: work out a less noisy diff'ing technique!
|
||||
if [ -f "${CLOG_PREV}" -a -f "${CLOG}" ]; then
|
||||
echo "${SELF}: See diff against previous log file (might be long):" | tee -a ${CLOG}
|
||||
echo "diff -Naur ${CLOG_PREV} ${CLOG} | less" | tee -a ${CLOG}
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
#
|
||||
boldify
|
||||
echo # | tee -a ${CLOG}
|
||||
echo "${SELF}: Leaving the following cruft in ${GEN_DATA_DIR}:" # | tee -a ${CLOG}
|
||||
unboldify
|
||||
ls -lth "${GEN_DATA_DIR}" # | tee -a ${CLOG}
|
||||
|
||||
# Fin
|
||||
if test "$exit_value" = 0
|
||||
then
|
||||
echo "${SELF}: +++ Test run and its log look like success."
|
||||
else
|
||||
echo
|
||||
echo "${SELF}: --- Test run detected some failures."
|
||||
echo
|
||||
fi
|
||||
exit $exit_value
|
||||
|
@ -1,135 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# === TEMPLATE: Add your own copyright here
|
||||
#
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
# === TEMPLATE: Remove this remark before releasing this script.
|
||||
#
|
||||
# This is a template for creating a new libisoburn/releng test.
|
||||
# It is supposed that you have read releng/README before you begin to work
|
||||
# here.
|
||||
#
|
||||
# Step 1: Invent a name for your test
|
||||
# test_name="manual_"...some.name...
|
||||
# or
|
||||
# test_name="auto_"...some.name...
|
||||
#
|
||||
# Step 2: Copy releng/template_new to $test_name
|
||||
#
|
||||
# Step 3: Edit $test_name and process any line that begins by
|
||||
# "# === TEMPLATE:". Do what the line prescribes and then remove it
|
||||
# from the script. You are not done as long as such a line remains.
|
||||
#
|
||||
# === TEMPLATE: End of remark to remove
|
||||
|
||||
set -e
|
||||
|
||||
|
||||
# === TEMPLATE: Describe your own specific options (if any) and the test
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
--option Explanation of specific option
|
||||
Overview:
|
||||
Short explanation of test purpose and activities.
|
||||
HLP
|
||||
}
|
||||
|
||||
|
||||
getopts_inc=inc/releng_getopts.inc
|
||||
if test -e "$getopts_inc"
|
||||
then
|
||||
. "$getopts_inc"
|
||||
|
||||
if test "$SPECIFIC_HELP" = 1
|
||||
then
|
||||
print_specific_help
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo >&2
|
||||
echo "File not found: $getopts_inc" >&2
|
||||
echo "Are we in the ./releng directory of a libisoburn SVN checkout ?" >&2
|
||||
echo "(Please execute the tests from that ./releng directory.)" >&2
|
||||
echo >&2
|
||||
exit 29
|
||||
fi
|
||||
|
||||
|
||||
# === TEMPLATE: Decide whether the test will have own options,
|
||||
# === TEMPLATE: apart from those interpreted by inc/releng_getopts.inc
|
||||
# === TEMPLATE: If not, then remove this interpreter code.
|
||||
# Set default values for specific option variables. E.g.:
|
||||
# dev=
|
||||
# Interpret specific options, they begin after the first --.
|
||||
next_is=ignore
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then
|
||||
if test "$i" = "--"
|
||||
then
|
||||
next_is=""
|
||||
fi
|
||||
|
||||
# === TEMPLATE: Implement interpretation of specific options. Like:
|
||||
# elif test "$next_is" = "dev"
|
||||
# then
|
||||
# dev="$i"
|
||||
# next_is=""
|
||||
# elif test "$i" = "--dev"
|
||||
# then
|
||||
# next_is="dev"
|
||||
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown test specific option: $i" >&2
|
||||
print_help
|
||||
print_specific_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
# === TEMPLATE: End of own option interpreter code.
|
||||
|
||||
|
||||
# Each test should decide whether or not it needs
|
||||
# a xorriso binary to test, since some do compilations only.
|
||||
# === TEMPLATE: Decide whether you need a xorriso program.
|
||||
# === TEMPLATE: If not, then remove this function call
|
||||
check_for_xorriso -x
|
||||
|
||||
|
||||
# check data dir, if any and after checking -x xorriso
|
||||
# === TEMPLATE: Decide whether your test will possibly create own files.
|
||||
# === TEMPLATE: If yes, then create your files underneath ${GEN_DATA_DIR}.
|
||||
# === TEMPLATE: The name in this variable is set by inc/releng_getopts.inc .
|
||||
# === TEMPLATE: If not, then remove this if ... fi statement.
|
||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
|
||||
exit 30
|
||||
else
|
||||
mkdir "${GEN_DATA_DIR}"
|
||||
fi
|
||||
|
||||
|
||||
#####################################################################
|
||||
|
||||
|
||||
# === TEMPLATE: Perform your test activities here.
|
||||
|
||||
|
||||
# === TEMPLATE: In case of failure, issue a line to stdout that begins by
|
||||
# === TEMPLATE: the word "FAIL", and make sure that the test script finally
|
||||
# === TEMPLATE: returns a non-zero exit value.
|
||||
# === TEMPLATE: 31 = Unknown option or unusable argument with known option
|
||||
# === TEMPLATE: 30 = Unexpected state of own directory for self generated files
|
||||
# === TEMPLATE: 29 = Not in ./releng directory or missing essential parts
|
||||
# === TEMPLATE: 1 to 28 = test specific exit values
|
||||
# === TEMPLATE: When exiting prematurely, make sure to call cleanup.
|
||||
|
||||
cleanup
|
||||
exit 0
|
@ -5,7 +5,7 @@
|
||||
To compare tree /media/dvd and /original/dir :
|
||||
find /media/dvd -exec compare_file '{}' /media/dvd /original/dir ';'
|
||||
|
||||
Copyright 2008 - 2015 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2008 - 2010 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@ -28,10 +28,6 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
/* O_BINARY is needed for Cygwin but undefined elsewhere */
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
/* @param flag bit0= single letters */
|
||||
char *Ftypetxt(mode_t st_mode, int flag)
|
||||
@ -103,7 +99,6 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
|
||||
int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done;
|
||||
char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40];
|
||||
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
|
||||
double dcount;
|
||||
|
||||
ret= lstat(adr1, &s1);
|
||||
if(ret==-1) {
|
||||
@ -112,12 +107,10 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
|
||||
}
|
||||
strcpy(a, Ftypetxt(s1.st_mode, 1));
|
||||
strcat(a, " ");
|
||||
if(adrc[0]) {
|
||||
if(strlen(a) + strlen(adrc) < 4096)
|
||||
strcat(a, adrc);
|
||||
} else {
|
||||
if(adrc[0])
|
||||
strcat(a, adrc);
|
||||
else
|
||||
strcat(a, ".");
|
||||
}
|
||||
|
||||
ret= lstat(adr2, &s2);
|
||||
if(ret==-1) {
|
||||
@ -187,12 +180,12 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
|
||||
}
|
||||
}
|
||||
if(S_ISREG(s1.st_mode) && S_ISREG(s2.st_mode)) {
|
||||
fd1= open(adr1, O_RDONLY | O_BINARY);
|
||||
fd1= open(adr1, O_RDONLY);
|
||||
if(fd1==-1) {
|
||||
printf("- %s : cannot open() : %s\n", adr1, strerror(errno));
|
||||
return(0);
|
||||
}
|
||||
fd2= open(adr2, O_RDONLY | O_BINARY);
|
||||
fd2= open(adr2, O_RDONLY);
|
||||
if(fd2==-1) {
|
||||
printf("- %s : cannot open() : %s\n", adr2, strerror(errno));
|
||||
close(fd1);
|
||||
@ -242,13 +235,9 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
|
||||
if(diffcount>0 || r1count!=r2count) {
|
||||
if(first_diff<0)
|
||||
first_diff= (r1count>r2count ? r2count : r1count);
|
||||
if(r1count > r2count)
|
||||
dcount= diffcount + (r1count - r2count);
|
||||
else
|
||||
dcount= diffcount + (r2count - r1count);
|
||||
printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a,
|
||||
(s1.st_mtime==s2.st_mtime ? "CONTENT":"content"),
|
||||
dcount, (double) first_diff);
|
||||
(double) (diffcount + abs(r1count-r2count)), (double) first_diff);
|
||||
differs= 1;
|
||||
}
|
||||
}
|
||||
@ -289,24 +278,10 @@ int main(int argc, char **argv)
|
||||
argv[0], argv[1], argv[2]);
|
||||
exit(2);
|
||||
}
|
||||
if(strlen(argv[1]) >= 4096) {
|
||||
fprintf(stderr, "path exceeds size limit of 4095\n");
|
||||
exit(3);
|
||||
}
|
||||
if(strlen(argv[1]) - strlen(argv[2]) > 4000) {
|
||||
fprintf(stderr, "common address part exceeds size limit of 4000\n");
|
||||
exit(3);
|
||||
}
|
||||
if(strlen(argv[3]) + 1 + strlen(argv[1]) - strlen(argv[2]) >= 4096) {
|
||||
fprintf(stderr, "prefix2 exceeds size limit of 4095\n");
|
||||
exit(3);
|
||||
}
|
||||
strcpy(adr1, argv[1]);
|
||||
strcpy(adrc, argv[1]+strlen(argv[2]));
|
||||
strcpy(adr2, argv[3]);
|
||||
if(adrc[0] == '/' || adrc[0] == 0)
|
||||
strcat(adr2, "/");
|
||||
strcat(adr2, adrc);
|
||||
sprintf(adr2, "%s%s%s",
|
||||
argv[3], (adrc[0]=='/' || adrc[0]==0 ? "" : "/"), adrc);
|
||||
|
||||
ret= Compare_2_files(adr1, adr2, adrc, (with_ctime<<1));
|
||||
exit(ret<=0);
|
||||
|
@ -1,370 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo >&2
|
||||
echo "THIS SCRIPT IS DEPRECATED ! USE ITS SUCCESSOR: merge_debian_isos" >&2
|
||||
echo >&2
|
||||
echo "The script merge_2_debian_isos still exists only because it was mentioned">&2
|
||||
echo "in Debian bug 1011343. The successor can merge more than two ISOs.">&2
|
||||
echo "So do not edit this script to remove this warning and the 'exit 7' line.">&2
|
||||
echo >&2
|
||||
|
||||
exit 7
|
||||
|
||||
usage() {
|
||||
echo "usage: $(basename "$0") "'\' >&2
|
||||
echo " boot_iso boot_mount add_iso add_mount result_iso [for_dist]" >&2
|
||||
echo >&2
|
||||
echo "Mounts by sudo the boot_iso at directory boot_mount and add_iso at" >&2
|
||||
echo "add_mount, if not already mounted that way. Then both Debian pools" >&2
|
||||
echo "and package lists get merged and a new ISO 9660 image result_iso" >&2
|
||||
echo "is produced, which must not yet exist." >&2
|
||||
echo "If boot_iso is bootable then the new image will be bootable by the" >&2
|
||||
echo "same means." >&2
|
||||
echo "This script creates the following temporary tree and files which" >&2
|
||||
echo "must not yet exist in the current working directory:" >&2
|
||||
echo " ./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt" >&2
|
||||
echo " ./temp_file" >&2
|
||||
echo "The optional sixth argument for_dist should only be given if" >&2
|
||||
echo "this script refuses to work and proposes to give this argument." >&2
|
||||
echo "Exported non-empty variable MERGE_DATE enforces a particular" >&2
|
||||
echo "date string in the text which gets prepended to /README.txt ." >&2
|
||||
echo "Exported non-empty variable XORRISO overrides command xorriso," >&2
|
||||
echo "which may be needed if installed xorriso is older than 1.4.2." >&2
|
||||
echo "Example using GNU xorriso-1.5.4 instead of /usr/bin/xorriso:" >&2
|
||||
echo " export XORRISO="'$HOME'"/xorriso-1.5.4/xorriso/xorriso" >&2
|
||||
echo " $(basename "$0") debian-11.2.0-amd64-DVD-1.iso /mnt/iso1 "'\' >&2
|
||||
echo " debian-11.2.0-amd64-DVD-2.iso /mnt/iso2 merged.iso" >&2
|
||||
}
|
||||
|
||||
if test "$#" -lt 5
|
||||
then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BOOT_ISO="$1"
|
||||
BOOT_ISO_MOUNT="$2"
|
||||
ADD_ISO="$3"
|
||||
ADD_ISO_MOUNT="$4"
|
||||
RESULT_ISO="$5"
|
||||
|
||||
# The sixth argument is optional
|
||||
FOR_DIST="$6"
|
||||
|
||||
|
||||
## Check arguments
|
||||
|
||||
if test -e "$RESULT_ISO"
|
||||
then
|
||||
echo "--- A file '""$RESULT_ISO""' is already existing." >&2
|
||||
echo "--- Will not overwrite it by the resulting ISO image." >&2
|
||||
exit 1
|
||||
fi
|
||||
if test -e merged_dists || test -e merged_md5sum.txt || test -e temp_file \
|
||||
|| test -e merged_README.txt
|
||||
then
|
||||
echo "--- At least one of ./merged_dists, ./merged_md5sum.txt, ./temp_file," >&2
|
||||
echo "--- or merged_README.txt is already existing. Will not overwrite them." >&2
|
||||
exit 1
|
||||
fi
|
||||
if test "$BOOT_ISO" = "$RESULT_ISO" || test "$BOOT_ISO" = "$ADD_ISO" || \
|
||||
test "$ADD_ISO" = "$RESULT_ISO"
|
||||
then
|
||||
echo "--- At least two of the three given ISO image paths are equal." >&2
|
||||
echo "--- boot_iso and add_iso must exist and differ, result_iso must not exist." >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
## Mount and copy out the files which need to be changed
|
||||
|
||||
do_mount_1=1
|
||||
x=$(mount | grep " $BOOT_ISO_MOUNT " | awk '{print $1}')
|
||||
if test -n "$x"
|
||||
then
|
||||
i1=$(ls -i "$x" | awk '{print $1}')
|
||||
i2=$(ls -i "$BOOT_ISO" | awk '{print $1}')
|
||||
if test "$i1" = "$i2"
|
||||
then
|
||||
do_mount_1=0
|
||||
echo "Note: Found $BOOT_ISO already mounted at $BOOT_ISO_MOUNT"
|
||||
fi
|
||||
fi
|
||||
if test "$do_mount_1" = 1
|
||||
then
|
||||
echo "Note: sudo mount $BOOT_ISO $BOOT_ISO_MOUNT"
|
||||
sudo mount "$BOOT_ISO" "$BOOT_ISO_MOUNT" || exit 3
|
||||
fi
|
||||
cp -a "$BOOT_ISO_MOUNT/dists" merged_dists
|
||||
cp -a "$BOOT_ISO_MOUNT/md5sum.txt" merged_md5sum.txt
|
||||
chmod -R u+w merged_dists
|
||||
chmod u+w merged_md5sum.txt
|
||||
|
||||
do_mount_2=1
|
||||
x=$(mount | grep " $ADD_ISO_MOUNT " | awk '{print $1}')
|
||||
if test -n "$x"
|
||||
then
|
||||
i1=$(ls -i "$x" | awk '{print $1}')
|
||||
i2=$(ls -i "$ADD_ISO" | awk '{print $1}')
|
||||
if test "$i1" = "$i2"
|
||||
then
|
||||
do_mount_2=0
|
||||
echo "Note: Found $ADD_ISO already mounted at $ADD_ISO_MOUNT"
|
||||
fi
|
||||
fi
|
||||
if test "$do_mount_2" = 1
|
||||
then
|
||||
echo "Note: sudo mount $ADD_ISO $ADD_ISO_MOUNT"
|
||||
if sudo mount "$ADD_ISO" "$ADD_ISO_MOUNT"
|
||||
then
|
||||
dummy=dummy
|
||||
else
|
||||
if test "$do_mount_1"
|
||||
then
|
||||
sudo umount "$BOOT_ISO_MOUNT"
|
||||
fi
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
## Helper functions
|
||||
|
||||
# Put out the list of checksummed paths as listed in /dists/$dist/Release
|
||||
extract_checksum_paths() {
|
||||
mode=0
|
||||
cat "$1" | \
|
||||
while true
|
||||
do
|
||||
read x || break
|
||||
if test "$x" = "MD5Sum:" || test "$x" = "SHA1:" \
|
||||
|| test "$x" = "SHA256:" || test "$x" = "SHA512:"
|
||||
then
|
||||
if test "$mode" = 0
|
||||
then
|
||||
mode=1
|
||||
elif test "$mode" = 1
|
||||
then
|
||||
break
|
||||
fi
|
||||
elif test "$mode" = 1
|
||||
then
|
||||
echo "$x"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Put out the part before the first checksum field
|
||||
extract_release_head() {
|
||||
cat "$1" | \
|
||||
while true
|
||||
do
|
||||
read x || break
|
||||
if test "$x" = "MD5Sum:" || test "$x" = "SHA1:" \
|
||||
|| test "$x" = "SHA256:" || test "$x" = "SHA512:"
|
||||
then
|
||||
break
|
||||
fi
|
||||
echo "$x"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
## Determine which Debian release is on BOOT_ISO
|
||||
|
||||
dist=
|
||||
for i in $(ls -1d "$BOOT_ISO_MOUNT"/dists/*)
|
||||
do
|
||||
if test -d "$i"
|
||||
then
|
||||
if test -L "$i"
|
||||
then
|
||||
continue
|
||||
fi
|
||||
test -n "$dist" && dist="$dist "
|
||||
dist="$dist""$(basename $i)"
|
||||
fi
|
||||
done
|
||||
if test -z "$dist"
|
||||
then
|
||||
if test -z "$FOR_DIST"
|
||||
then
|
||||
echo "--- Cannot determine Debian release from directories in /dists" >&2
|
||||
echo "--- (You may provide the release name as sixth argument)" >&2
|
||||
echo >&2
|
||||
usage
|
||||
exit 2
|
||||
fi
|
||||
elif test "$(echo "$dist" | wc -w)" -gt 1
|
||||
then
|
||||
if test -z "$FOR_DIST"
|
||||
then
|
||||
echo "--- More than one Debian release found in /dists: $dist" >&2
|
||||
echo "--- (You may provide the release name as sixth argument)" >&2
|
||||
echo >&2
|
||||
usage
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
if test -n "$FOR_DIST"
|
||||
then
|
||||
echo "Note: Overriding release name '$dist' by '""$FOR_DIST""'" >&2
|
||||
dist="$FOR_DIST"
|
||||
fi
|
||||
if test -d "$BOOT_ISO_MOUNT"/dists/"$dist"
|
||||
then
|
||||
echo "Note: Will work along $BOOT_ISO_MOUNT"/dists/"$dist"/Release >&2
|
||||
else
|
||||
echo "--- Cannot find directory $BOOT_ISO_MOUNT"/dists/"$dist" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
## Prepend info to /README.txt
|
||||
|
||||
if test -z "$MERGE_DATE"
|
||||
then
|
||||
MERGE_DATE=$(date +'%Y%m%d-%H:%M')
|
||||
fi
|
||||
printf 'Result of a run of %s at %s\r\n' \
|
||||
"$(basename $0)" "$MERGE_DATE" >temp_file
|
||||
printf 'Package pools and Packages lists were merged.\r\n' >>temp_file
|
||||
printf 'The other files stem from the first input ISO.\r\n' >>temp_file
|
||||
printf '\r\n' >>temp_file
|
||||
printf 'Input ISO: %s\r\n' "$BOOT_ISO" >>temp_file
|
||||
head -2 "$BOOT_ISO_MOUNT"/README.txt >>temp_file
|
||||
printf '\r\n' >>temp_file
|
||||
printf 'Input ISO: %s\r\n' "$ADD_ISO" >>temp_file
|
||||
head -2 "$ADD_ISO_MOUNT"/README.txt >>temp_file
|
||||
printf '\r\n' >>temp_file
|
||||
printf '%s%s\r\n' " --------------------------------------" \
|
||||
"----------------------------------------" >>temp_file
|
||||
printf '\r\n' >>temp_file
|
||||
cat "$BOOT_ISO_MOUNT"/README.txt >>temp_file
|
||||
|
||||
mv temp_file merged_README.txt
|
||||
|
||||
|
||||
## Merge package description files with those from "$ADD_ISO"
|
||||
|
||||
# /md5sum.txt seems to be the only overall package list
|
||||
cat merged_md5sum.txt "$ADD_ISO_MOUNT"/md5sum.txt | sort >temp_file
|
||||
mv temp_file merged_md5sum.txt
|
||||
|
||||
# Determine the files which are mentioned with checksum in main Release files
|
||||
path_list=$( (extract_checksum_paths merged_dists/"$dist"/Release
|
||||
extract_checksum_paths "$ADD_ISO_MOUNT"/dists/"$dist"/Release ) \
|
||||
| awk '{print $3}' | sort | uniq )
|
||||
|
||||
# Merge .gz files (Release should not be merged. Unclear what others need.)
|
||||
for i in $path_list
|
||||
do
|
||||
if echo "$i" | grep -v '.gz$' >/dev/null
|
||||
then
|
||||
continue
|
||||
fi
|
||||
if test -e merged_dists/"$dist"/"$i"
|
||||
then
|
||||
if test -e "$ADD_ISO_MOUNT"/dists/"$dist"/"$i"
|
||||
then
|
||||
if test "$(gunzip <merged_dists/"$dist"/"$i" | tail -1)" = ""
|
||||
then
|
||||
empty_line=
|
||||
else
|
||||
empty_line=echo
|
||||
fi
|
||||
( gunzip <merged_dists/"$dist"/"$i"
|
||||
$empty_line
|
||||
gunzip <"$ADD_ISO_MOUNT"/dists/"$dist"/"$i" ) | gzip >temp_file
|
||||
mv temp_file merged_dists/"$dist"/"$i"
|
||||
fi
|
||||
elif test -e "$ADD_ISO_MOUNT"/dists/"$dist"/"$i"
|
||||
then
|
||||
if test -e $(dirname merged_dists/"$dist"/"$i")
|
||||
then
|
||||
dummy=dummy
|
||||
else
|
||||
mkdir -p $(dirname merged_dists/"$dist"/"$i")
|
||||
fi
|
||||
cp "$ADD_ISO_MOUNT"/dists/"$dist"/"$i" merged_dists/"$dist"/"$i"
|
||||
fi
|
||||
test -e temp_file && rm temp_file
|
||||
done
|
||||
|
||||
|
||||
## Update dists/"$dist"/Release
|
||||
|
||||
extract_release_head merged_dists/"$dist"/Release >temp_file
|
||||
|
||||
# Re-create "MD5Sum:", "SHA256:", "SHA512:" sections
|
||||
for cmd in md5sum sha1sum sha256sum sha512sum
|
||||
do
|
||||
if type "$cmd" >/dev/null
|
||||
then
|
||||
case "$cmd" in
|
||||
md5sum) echo "MD5Sum:" ;;
|
||||
sha1sum) echo "SHA1:" ;;
|
||||
sha256sum) echo "SHA256:" ;;
|
||||
sha512sum) echo "SHA512:" ;;
|
||||
esac
|
||||
for i in $path_list
|
||||
do
|
||||
file=merged_dists/"$dist"/"$i"
|
||||
if test -e "$file"
|
||||
then
|
||||
sum=$("$cmd" "$file" | awk '{print $1}')
|
||||
size=$(stat -c '%s' "$file")
|
||||
elif test -e "$file".gz
|
||||
then
|
||||
sum=$(gunzip <"$file".gz | "$cmd" | awk '{print $1}')
|
||||
size=$(gunzip <"$file".gz | wc -c)
|
||||
else
|
||||
continue
|
||||
fi
|
||||
list_path=$(echo "$file" | sed -e 's/^merged_dists\/'"$dist"'\///')
|
||||
printf ' %s %8ld %s\n' "$sum" "$size" "$list_path"
|
||||
done
|
||||
fi
|
||||
done >>temp_file
|
||||
|
||||
mv temp_file merged_dists/"$dist"/Release
|
||||
|
||||
|
||||
## Produce the new ISO image
|
||||
|
||||
if test -z "$XORRISO"
|
||||
then
|
||||
XORRISO=xorriso
|
||||
fi
|
||||
|
||||
"$XORRISO" \
|
||||
-indev "$BOOT_ISO" \
|
||||
-outdev "$RESULT_ISO" \
|
||||
-map "$ADD_ISO_MOUNT"/pool /pool \
|
||||
-map merged_dists /dists \
|
||||
-map merged_md5sum.txt /md5sum.txt \
|
||||
-map merged_README.txt /README.txt \
|
||||
-chown_r 0 /dists /md5sum.txt /README.txt -- \
|
||||
-chgrp_r 0 /dists /md5sum.txt /README.txt -- \
|
||||
-chmod_r a-w /dists /md5sum.txt -- \
|
||||
-chmod_r a=r /README.txt -- \
|
||||
-boot_image any replay \
|
||||
-stdio_sync off \
|
||||
-padding included \
|
||||
-compliance no_emul_toc
|
||||
|
||||
|
||||
## Clean up
|
||||
|
||||
if test "$do_mount_1" = 1
|
||||
then
|
||||
sudo umount "$BOOT_ISO_MOUNT"
|
||||
fi
|
||||
if test "$do_mount_2" = 1
|
||||
then
|
||||
sudo umount "$ADD_ISO_MOUNT"
|
||||
fi
|
||||
|
||||
rm -r merged_dists merged_md5sum.txt merged_README.txt
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,293 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\"
|
||||
.\" IMPORTANT NOTE:
|
||||
.\"
|
||||
.\" The original of this file is kept in test/merge_debian_isos.texi
|
||||
.\" This here was generated by program xorriso/make_xorriso_1
|
||||
.\"
|
||||
.\"
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH MERGE_DEBIAN_ISOS 1 "Version 1.5.5, Oct 19, 2022"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.nh
|
||||
.SH NAME
|
||||
merge_debian_isos \- Program to merge multiple debian\-cd ISO images
|
||||
.SH SYNOPSIS
|
||||
.B merge_debian_isos
|
||||
result_iso mount_template iso1 iso2 [... isoN]
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBmerge_debian_isos\fR
|
||||
mounts by \fBsudo\fR the ISO 9660 images iso1 to isoN at directories
|
||||
mount_template1 to mount_templateN, if not already mounted that way.
|
||||
Then the Debian pools and package lists get merged and a new
|
||||
ISO 9660 image result_iso is produced by a run of \fBxorriso\fR.
|
||||
If iso1 is bootable then
|
||||
the new image will be bootable by the same means.
|
||||
.br
|
||||
.PP
|
||||
The file depicted by result_iso must not yet exist or has to be a
|
||||
device which is acceptable for Linux\-specific helper script
|
||||
\fBxorriso\-dd\-target\fR. If xorriso\-dd\-target agrees and the user
|
||||
confirms by input "yes" then xorriso will be run under sudo.
|
||||
.br
|
||||
Exempted from this evaluation are addresses which begin by "mmc:"
|
||||
for an optical drive on Linux, BSDs, Solaris, or by "stdio:/dev/"
|
||||
for which the user takes full and dangerous responsibility.
|
||||
.br
|
||||
Special result_iso path \fBxorriso\-dd\-target\-plug\-test\fR determines
|
||||
on systems with Linux kernel the target USB stick by a dialog around plugging
|
||||
it in.
|
||||
xorriso will be run under sudo, if xorriso\-dd\-target agrees and
|
||||
the user confirms by input "yes".
|
||||
.br
|
||||
.PP
|
||||
At least the parent directory of argument \fBmount_template\fR must already
|
||||
exist or has to be given by a plain name without "/" so that it can be
|
||||
created in the current directory. (I.e. without even "./".)
|
||||
.br
|
||||
All arguments must be single words without using quotation marks.
|
||||
None of the isoN must be equal to another isoM.
|
||||
.br
|
||||
.PP
|
||||
This script creates and finally removes the following temporary tree
|
||||
and files which must not yet exist in the current working directory:
|
||||
./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt
|
||||
./temp_file
|
||||
.br
|
||||
Further it creates and finally removes directories mount_template*
|
||||
if they are needed and do not exist when the script starts. If the
|
||||
parent directory in the mount_template path does not exist and
|
||||
its path contains no "/" then it gets created and finally removed.
|
||||
The script depends on the following programs:
|
||||
.br
|
||||
awk, basename, cat, chmod, cp, date, dirname, expr, fgrep, grep,
|
||||
gunzip, gzip, head, ls, md5sum, mkdir, mount, mv, rm, rmdir,
|
||||
sed, sh, sha256sum, sort, stat, sudo, umount, uniq, xorriso
|
||||
.br
|
||||
With device writing involving helper script xorriso\-dd\-target:
|
||||
.br
|
||||
dd, Linux kernel, lsblk, sleep, tr, uname, wc, whoami,
|
||||
xorriso\-dd\-target
|
||||
.br
|
||||
Recommended are: sha1sum, sha512sum
|
||||
|
||||
.SS
|
||||
.br
|
||||
.SH OPTIONS
|
||||
.br
|
||||
.PP
|
||||
merge_debian_isos has no command line options besides the input words described
|
||||
above, but it reacts on some environment variables.
|
||||
.br
|
||||
See section ENVIRONMENT.
|
||||
.br
|
||||
.PP
|
||||
If less than 4 arguments are given, the script will print its help text to
|
||||
standard error and exit with non\-zero value, indicating failure.
|
||||
.SS
|
||||
.SH EXAMPLES
|
||||
.SS
|
||||
.B Overview of examples:
|
||||
Merge DVD images 1 to 5
|
||||
.br
|
||||
Use GNU xorriso instead of installed xorriso
|
||||
.br
|
||||
Write result directly to an optical drive
|
||||
.br
|
||||
Write result directly and safely to USB stick (Linux only)
|
||||
.br
|
||||
Write result directly and unsafely to USB stick
|
||||
.SS
|
||||
.B Merge DVD images 1 to 5
|
||||
The resulting image will be named "merged.iso".
|
||||
.br
|
||||
Directory ./merge_mount/ will be created if not yet existing.
|
||||
.br
|
||||
|
||||
merge_debian_isos merged.iso merge_mount/iso \\
|
||||
debian\-11.2.0\-amd64\-DVD\-[12345].iso
|
||||
|
||||
.br
|
||||
Expect to see some harmless warnings like
|
||||
.br
|
||||
|
||||
xorriso : WARNING : \-volid text does not comply to ISO 9660 / ECMA 119 rules
|
||||
|
||||
libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can only be added to a Rock Ridge tree.
|
||||
|
||||
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align partition.
|
||||
|
||||
.SS
|
||||
.B Use GNU xorriso instead of installed xorriso
|
||||
merge_debian_isos will refuse to work if the installed version of xorriso
|
||||
is older than 1.4.2. In this case consider to download and compile the
|
||||
GNU xorriso tarball from
|
||||
.br
|
||||
https://www.gnu.org/software/xorriso/#download
|
||||
.br
|
||||
You may use it without installing it after compilation and thus without
|
||||
disturbing your system's package management. Assumed that you unpacked the
|
||||
xorriso\-1.5.4 tarball in your $HOME directory and have successfully compiled
|
||||
it, do:
|
||||
.br
|
||||
|
||||
export XORRISO="$HOME"/xorriso\-1.5.4/xorriso/xorriso
|
||||
.br
|
||||
|
||||
merge_debian_isos merged.iso merge_mount/iso \\
|
||||
debian\-11.2.0\-amd64\-DVD\-[12345].iso
|
||||
|
||||
.SS
|
||||
.B Write result directly to an optical drive
|
||||
xorriso is able to burn optical media on GNU/Linux (/dev/sr*),
|
||||
Solaris (/dev/rdsk/*) , FreeBSD (/dev/cd*) , NetBSD (/dev/rcd*),
|
||||
and OpenBSD (/dev/rcd*). Get a list of available optical drive devices by:
|
||||
.br
|
||||
|
||||
xorriso \-devices
|
||||
.br
|
||||
|
||||
It might be that you need superuser powers for this and then have to enable
|
||||
access to the device file for the user who runs merge_debian_isos.
|
||||
.br
|
||||
|
||||
In order to directly write the merged ISO image to an optical medium,
|
||||
use the desired device file path with prefix "mmc:":
|
||||
.br
|
||||
|
||||
merge_debian_isos mmc:/dev/sr0 merge_mount/iso \\
|
||||
debian\-11.2.0\-amd64\-DVD\-[12345].iso
|
||||
|
||||
.SS
|
||||
.B Write result directly and safely to USB stick (Linux only)
|
||||
The Linux\-specific script \fBxorriso\-dd\-target\fR evaluates device files
|
||||
whether they and their content look unimportant enough for being overwritten
|
||||
by an image file.
|
||||
.br
|
||||
This mainly means that the storage device is attached to USB and contains
|
||||
no filesystems which are not of type FAT or ISO 9660.
|
||||
.br
|
||||
You may get xorriso\-dd\-target by:
|
||||
.br
|
||||
|
||||
wget \\
|
||||
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso\-dd\-target/xorriso\-dd\-target
|
||||
chmod u+x xorriso\-dd\-target
|
||||
.br
|
||||
|
||||
Consider to also download xorriso\-dd\-target.sig and to verify the script by
|
||||
.br
|
||||
|
||||
gpg \-\-verify xorriso\-dd\-target.sig xorriso\-dd\-target
|
||||
.br
|
||||
|
||||
Announce the storage location of the downloaded xorriso\-dd\-target:
|
||||
.br
|
||||
|
||||
export XORRISO_DD_TARGET_PATH="$(pwd)"
|
||||
.br
|
||||
|
||||
The prepared use case in merge_debian_isos uses the xorriso\-dd\-target
|
||||
option \-plug_test under \fBsudo\fR, which asks the user for first having
|
||||
the desired USB stick unplugged so that the unwanted devices can get
|
||||
registered. Then it asks the user to plug in the USB stick, so that it gets
|
||||
recognized as desired target.
|
||||
.br
|
||||
xorriso\-dd\-target evaluates the content and decides whether it looks
|
||||
disposable enough. If so, then it allows merge_debian_isos to write its
|
||||
result to the device.
|
||||
.br
|
||||
|
||||
merge_debian_isos xorriso\-dd\-target\-plug\-test merge_mount/iso \\
|
||||
debian\-11.2.0\-amd64\-DVD\-[12345].iso
|
||||
|
||||
.SS
|
||||
.B Write result directly and unsafely to USB stick
|
||||
On operating systems other than GNU/Linux or with storage devices not
|
||||
acceptable to xorriso\-dd\-target it is possible to remove all safety
|
||||
precautions beyond those of xorriso, which can be overcome by "blanking"
|
||||
the device.
|
||||
.br
|
||||
So after due evaluation of the device situation and on your very own risk
|
||||
you may use the device path prefix "stdio:", possibly with superuser powers:
|
||||
.br
|
||||
|
||||
xorriso \-outdev stdio:/dev/sdd \-blank as_needed
|
||||
|
||||
merge_debian_isos stdio:/dev/sdd merge_mount/iso \\
|
||||
debian\-11.2.0\-amd64\-DVD\-[12345].iso
|
||||
|
||||
For details about "stdio:" and pseudo\-blanking non\-optical devices read
|
||||
man xorriso.
|
||||
.br
|
||||
The xorriso run in merge_debian_isos ignores locally defined xorriso startup
|
||||
files (by command \-no_rc).
|
||||
.SH FILES
|
||||
For now, no files are defined for configuration.
|
||||
.SH ENVIRONMENT
|
||||
The following environment variables influence the program behavior:
|
||||
.br
|
||||
Exported non\-empty variable MERGE_DATE enforces a particular
|
||||
date string in the text which gets prepended to /README.txt .
|
||||
.br
|
||||
Exported non\-empty variable MERGE_FOR_DIST enforces the use of a
|
||||
particular directory in /dists of iso1. Normally only one
|
||||
such directory is found and thus no need to set MERGE_FOR_DIST.
|
||||
.br
|
||||
Exported non\-empty variable MERGE_KEEP_ISO prevents the removal
|
||||
of result_iso after xorriso indicated failure of production.
|
||||
.br
|
||||
Exported non\-empty variable XORRISO gives the path to a xorriso binary,
|
||||
which will be used instead of the system\-wide installed xorriso binary.
|
||||
This may be needed if installed xorriso is older than 1.4.2.
|
||||
.br
|
||||
If XORRISO is set to "dummy" then no new ISO will emerge.
|
||||
.br
|
||||
Exported non\-empty variable XORRISO_DD_TARGET_PATH names the
|
||||
directory where to find xorriso\-dd\-target, which evaluates the
|
||||
suitability of result_iso devices or does the plug\-test dialog.
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.BR xorriso(1),
|
||||
.BR xorriso-dd-target(1),
|
||||
.SH BUGS
|
||||
To report bugs, request help, or suggest enhancements for
|
||||
\fBmerge_debian_isos\fR,
|
||||
please send electronic mail to the public list <bug\-xorriso@gnu.org>.
|
||||
If more privacy is desired, mail to <scdbackup@gmx.net>.
|
||||
.br
|
||||
Please describe what you expect the program to do, the program arguments
|
||||
which you used, the messages of \fBmerge_debian_isos\fR, and the
|
||||
undesirable outcome of your program run.
|
||||
.br
|
||||
Expect to get asked more questions before solutions can be proposed.
|
||||
.SH AUTHOR
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
.br
|
||||
for libburnia\-project.org
|
||||
.SH COPYRIGHT
|
||||
Copyright (c) 2022 Thomas Schmitt
|
||||
.br
|
||||
Permission is granted to distribute this text freely. It shall only be
|
||||
modified in sync with the technical properties of merge_debian_isos.
|
||||
If you make use of the license to derive modified versions of merge_debian_isos
|
||||
then you are entitled to modify this text under that same license.
|
||||
.SH CREDITS
|
||||
\fBmerge_debian_isos\fR was originally developed with advise and testing
|
||||
by Zhang Boyang in the course of Debian bug #1011343. Steve McIntyre provided
|
||||
information about various file aspects of debian\-cd ISO images.
|
@ -1,359 +0,0 @@
|
||||
This is merge_debian_isos.info, produced by makeinfo version 5.2 from
|
||||
merge_debian_isos.texi.
|
||||
|
||||
merge_debian_isos - sh script to merge multiple debian-cd ISO images
|
||||
|
||||
Copyright (C) 2022 Thomas Schmitt
|
||||
|
||||
Permission is granted to distribute this text freely.
|
||||
INFO-DIR-SECTION Archiving
|
||||
START-INFO-DIR-ENTRY
|
||||
* Merge_debian_isos: (merge_debian_isos). Merge debian-cd ISO images to a single image
|
||||
END-INFO-DIR-ENTRY
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Top, Next: Overview, Up: (dir)
|
||||
|
||||
merge_debian_isos 1.5.5
|
||||
***********************
|
||||
|
||||
merge_debian_isos - Program to merge multiple debian-cd ISO images
|
||||
* Menu:
|
||||
|
||||
* Overview:: Overview
|
||||
* Options:: Options
|
||||
* Examples:: Examples
|
||||
* Files:: Files
|
||||
* Environ:: Environment
|
||||
* Seealso:: See also
|
||||
* Bugreport:: Reporting bugs
|
||||
* Legal:: Author, Copyright, Credits
|
||||
* CommandIdx:: Alphabetic Option List
|
||||
* ConceptIdx:: Alphabetic List of Concepts and Objects
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Overview, Next: Options, Prev: Top, Up: Top
|
||||
|
||||
1 Overview
|
||||
**********
|
||||
|
||||
'merge_debian_isos' mounts by *sudo* the ISO 9660 images iso1 to isoN at
|
||||
directories mount_template1 to mount_templateN, if not already mounted
|
||||
that way. Then the Debian pools and package lists get merged and a new
|
||||
ISO 9660 image result_iso is produced by a run of *xorriso*. If iso1 is
|
||||
bootable then the new image will be bootable by the same means.
|
||||
|
||||
The file depicted by result_iso must not yet exist or has to be a
|
||||
device which is acceptable for Linux-specific helper script
|
||||
*xorriso-dd-target*. If xorriso-dd-target agrees and the user confirms
|
||||
by input "yes" then xorriso will be run under sudo.
|
||||
Exempted from this evaluation are addresses which begin by "mmc:" for an
|
||||
optical drive on Linux, BSDs, Solaris, or by "stdio:/dev/" for which the
|
||||
user takes full and dangerous responsibility.
|
||||
Special result_iso path *xorriso-dd-target-plug-test* determines on
|
||||
systems with Linux kernel the target USB stick by a dialog around
|
||||
plugging it in. xorriso will be run under sudo, if xorriso-dd-target
|
||||
agrees and the user confirms by input "yes".
|
||||
|
||||
At least the parent directory of argument *mount_template* must
|
||||
already exist or has to be given by a plain name without "/" so that it
|
||||
can be created in the current directory. (I.e. without even "./".)
|
||||
All arguments must be single words without using quotation marks. None
|
||||
of the isoN must be equal to another isoM.
|
||||
|
||||
This script creates and finally removes the following temporary tree
|
||||
and files which must not yet exist in the current working directory:
|
||||
./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt ./temp_file
|
||||
Further it creates and finally removes directories mount_template* if
|
||||
they are needed and do not exist when the script starts. If the parent
|
||||
directory in the mount_template path does not exist and its path
|
||||
contains no "/" then it gets created and finally removed. The script
|
||||
depends on the following programs:
|
||||
awk, basename, cat, chmod, cp, date, dirname, expr, fgrep, grep, gunzip,
|
||||
gzip, head, ls, md5sum, mkdir, mount, mv, rm, rmdir, sed, sh, sha256sum,
|
||||
sort, stat, sudo, umount, uniq, xorriso
|
||||
With device writing involving helper script xorriso-dd-target:
|
||||
dd, Linux kernel, lsblk, sleep, tr, uname, wc, whoami, xorriso-dd-target
|
||||
|
||||
Recommended are: sha1sum, sha512sum
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Options, Next: Examples, Prev: Overview, Up: Top
|
||||
|
||||
2 Options
|
||||
*********
|
||||
|
||||
merge_debian_isos has no command line options besides the input words
|
||||
described above, but it reacts on some environment variables.
|
||||
|
||||
If less than 4 arguments are given, the script will print its help
|
||||
text to standard error and exit with non-zero value, indicating failure.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Examples, Next: Files, Prev: Options, Up: Top
|
||||
|
||||
3 Examples
|
||||
**********
|
||||
|
||||
* Menu:
|
||||
|
||||
* ExPlain:: Merge DVD images 1 to 5
|
||||
* ExXorriso:: Use GNU xorriso instead of installed xorriso
|
||||
* ExOptical:: Write result directly to an optical drive
|
||||
* ExDdTarget:: Write result directly and safely to USB stick (Linux only)
|
||||
* ExStdio:: Write result directly and unsafely to USB stick
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ExPlain, Next: ExXorriso, Prev: Options, Up: Examples
|
||||
|
||||
3.1 Merge DVD images 1 to 5
|
||||
===========================
|
||||
|
||||
The resulting image will be named "merged.iso".
|
||||
Directory ./merge_mount/ will be created if not yet existing.
|
||||
|
||||
merge_debian_isos merged.iso merge_mount/iso \
|
||||
debian-11.2.0-amd64-DVD-[12345].iso
|
||||
|
||||
|
||||
|
||||
Expect to see some harmless warnings like
|
||||
|
||||
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA
|
||||
119 rules
|
||||
|
||||
libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can
|
||||
only be added to a Rock Ridge tree.
|
||||
|
||||
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align
|
||||
partition.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ExXorriso, Next: ExOptical, Prev: ExPlain, Up: Examples
|
||||
|
||||
3.2 Use GNU xorriso instead of installed xorriso
|
||||
================================================
|
||||
|
||||
merge_debian_isos will refuse to work if the installed version of
|
||||
xorriso is older than 1.4.2. In this case consider to download and
|
||||
compile the GNU xorriso tarball from
|
||||
https://www.gnu.org/software/xorriso/#download
|
||||
You may use it without installing it after compilation and thus without
|
||||
disturbing your system's package management. Assumed that you unpacked
|
||||
the xorriso-1.5.4 tarball in your $HOME directory and have successfully
|
||||
compiled it, do:
|
||||
|
||||
export XORRISO="$HOME"/xorriso-1.5.4/xorriso/xorriso
|
||||
|
||||
merge_debian_isos merged.iso merge_mount/iso \
|
||||
debian-11.2.0-amd64-DVD-[12345].iso
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ExOptical, Next: ExDdTarget, Prev: ExXorriso, Up: Examples
|
||||
|
||||
3.3 Write result directly to an optical drive
|
||||
=============================================
|
||||
|
||||
xorriso is able to burn optical media on GNU/Linux (/dev/sr*), Solaris
|
||||
(/dev/rdsk/*) , FreeBSD (/dev/cd*) , NetBSD (/dev/rcd*), and OpenBSD
|
||||
(/dev/rcd*). Get a list of available optical drive devices by:
|
||||
|
||||
xorriso -devices
|
||||
|
||||
It might be that you need superuser powers for this and then have to
|
||||
enable access to the device file for the user who runs
|
||||
merge_debian_isos.
|
||||
|
||||
In order to directly write the merged ISO image to an optical medium,
|
||||
use the desired device file path with prefix "mmc:":
|
||||
|
||||
merge_debian_isos mmc:/dev/sr0 merge_mount/iso \
|
||||
debian-11.2.0-amd64-DVD-[12345].iso
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ExDdTarget, Next: ExStdio, Prev: ExOptical, Up: Examples
|
||||
|
||||
3.4 Write result directly and safely to USB stick (Linux only)
|
||||
==============================================================
|
||||
|
||||
The Linux-specific script *xorriso-dd-target* evaluates device files
|
||||
whether they and their content look unimportant enough for being
|
||||
overwritten by an image file.
|
||||
This mainly means that the storage device is attached to USB and
|
||||
contains no filesystems which are not of type FAT or ISO 9660.
|
||||
You may get xorriso-dd-target by:
|
||||
|
||||
wget \
|
||||
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso-dd-target/xorriso-dd-target
|
||||
chmod u+x xorriso-dd-target
|
||||
|
||||
Consider to also download xorriso-dd-target.sig and to verify the
|
||||
script by
|
||||
|
||||
gpg -verify xorriso-dd-target.sig xorriso-dd-target
|
||||
|
||||
Announce the storage location of the downloaded xorriso-dd-target:
|
||||
|
||||
export XORRISO_DD_TARGET_PATH="$(pwd)"
|
||||
|
||||
The prepared use case in merge_debian_isos uses the xorriso-dd-target
|
||||
option -plug_test under *sudo*, which asks the user for first having the
|
||||
desired USB stick unplugged so that the unwanted devices can get
|
||||
registered. Then it asks the user to plug in the USB stick, so that it
|
||||
gets recognized as desired target.
|
||||
xorriso-dd-target evaluates the content and decides whether it looks
|
||||
disposable enough. If so, then it allows merge_debian_isos to write its
|
||||
result to the device.
|
||||
|
||||
merge_debian_isos xorriso-dd-target-plug-test merge_mount/iso \
|
||||
debian-11.2.0-amd64-DVD-[12345].iso
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ExStdio, Next: Files, Prev: ExDdTarget, Up: Examples
|
||||
|
||||
3.5 Write result directly and unsafely to USB stick
|
||||
===================================================
|
||||
|
||||
On operating systems other than GNU/Linux or with storage devices not
|
||||
acceptable to xorriso-dd-target it is possible to remove all safety
|
||||
precautions beyond those of xorriso, which can be overcome by "blanking"
|
||||
the device.
|
||||
So after due evaluation of the device situation and on your very own
|
||||
risk you may use the device path prefix "stdio:", possibly with
|
||||
superuser powers:
|
||||
|
||||
xorriso -outdev stdio:/dev/sdd -blank as_needed
|
||||
|
||||
merge_debian_isos stdio:/dev/sdd merge_mount/iso \
|
||||
debian-11.2.0-amd64-DVD-[12345].iso
|
||||
|
||||
For details about "stdio:" and pseudo-blanking non-optical devices
|
||||
read man xorriso.
|
||||
The xorriso run in merge_debian_isos ignores locally defined xorriso
|
||||
startup files (by command -no_rc).
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Files, Next: Environ, Prev: Examples, Up: Top
|
||||
|
||||
4 Files
|
||||
*******
|
||||
|
||||
For now, no files are defined for configuration.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Environ, Next: Seealso, Prev: Files, Up: Top
|
||||
|
||||
5 Environ
|
||||
*********
|
||||
|
||||
The following environment variables influence the program behavior:
|
||||
Exported non-empty variable MERGE_DATE enforces a particular date string
|
||||
in the text which gets prepended to /README.txt .
|
||||
Exported non-empty variable MERGE_FOR_DIST enforces the use of a
|
||||
particular directory in /dists of iso1. Normally only one such
|
||||
directory is found and thus no need to set MERGE_FOR_DIST.
|
||||
Exported non-empty variable MERGE_KEEP_ISO prevents the removal of
|
||||
result_iso after xorriso indicated failure of production.
|
||||
Exported non-empty variable XORRISO gives the path to a xorriso binary,
|
||||
which will be used instead of the system-wide installed xorriso binary.
|
||||
This may be needed if installed xorriso is older than 1.4.2.
|
||||
If XORRISO is set to "dummy" then no new ISO will emerge.
|
||||
Exported non-empty variable XORRISO_DD_TARGET_PATH names the directory
|
||||
where to find xorriso-dd-target, which evaluates the suitability of
|
||||
result_iso devices or does the plug-test dialog.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Seealso, Next: Bugreport, Prev: Environ, Up: Top
|
||||
|
||||
6 See also
|
||||
**********
|
||||
|
||||
xorriso(1), xorriso-dd-target(1)
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top
|
||||
|
||||
7 Reporting bugs
|
||||
****************
|
||||
|
||||
To report bugs, request help, or suggest enhancements for
|
||||
'merge_debian_isos', please send electronic mail to the public list
|
||||
<bug-xorriso@gnu.org>. If more privacy is desired, mail to
|
||||
<scdbackup@gmx.net>.
|
||||
|
||||
Please describe what you expect the program to do, the program
|
||||
arguments which you used, the messages of 'merge_debian_isos', and the
|
||||
undesirable outcome of your program run.
|
||||
|
||||
Expect to get asked more questions before solutions can be proposed.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top
|
||||
|
||||
8 Author, Copyright, Credits
|
||||
****************************
|
||||
|
||||
8.1 Author
|
||||
==========
|
||||
|
||||
Thomas Schmitt <scdbackup@gmx.net>
|
||||
for libburnia-project.org
|
||||
|
||||
8.2 Copyright
|
||||
=============
|
||||
|
||||
Copyright (c) 2022 Thomas Schmitt
|
||||
Permission is granted to distribute this text freely. It shall only be
|
||||
modified in sync with the technical properties of merge_debian_isos. If
|
||||
you make use of the license to derive modified versions of
|
||||
merge_debian_isos then you are entitled to modify this text under that
|
||||
same license.
|
||||
|
||||
8.3 Credits
|
||||
===========
|
||||
|
||||
'merge_debian_isos' was originally developed with advise and testing by
|
||||
Zhang Boyang in the course of Debian bug #1011343. Steve McIntyre
|
||||
provided information about various file aspects of debian-cd ISO images.
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
|
||||
|
||||
9 Alphabetic Options List
|
||||
*************************
|
||||
|
||||
|
||||
File: merge_debian_isos.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Up: Top
|
||||
|
||||
10 Alphabetic List of Concepts and Objects
|
||||
******************************************
|
||||
|
||||
|